Migration from virtuemart 3.0.6.2

  • Posts: 567
  • Thank you received: 11
  • Hikashop Business
9 years 3 months ago #211545

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.2
-- PHP version -- : 5.4.40
-- Error-message(debug-mod must be tuned on) -- : No error message
all hk_id in vm_prod table is the same

Hi

I tried to migrate from virtuemart 3.0.6 (i have 1700+ product in virtuemart)

the import process run success but with only 1 new product inserted

when i go to hikashop product panel, it become a blank screen

when i go to database and found that hikashop_vm_prod table have 1700+ records but all have the same hk_id

when i deleted the new inserted product in hikashop_product table , the blank page problem gone

any way to have a fix on this?

i understand that the import do not support 3.0.6 yet but we really love hikashop and would like to migrate to it

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #211597

Hi,

And what is the value in hk_id ?
Just before storing the values in "hikashop_vm_prod", the import is trying to import the data into the "hikashop_product" table.
For that import, it use the "virtuemart_products_XXX" table which is a language table ; it means that Virtuemart creates one table per language.
And if your VM products are not in the language table you choose, you won't be able to import any data.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 567
  • Thank you received: 11
  • Hikashop Business
9 years 3 months ago #211601

It created 1700+ record in hikashop_vm_product table with hk_id 36285

The product with id 36285 is the first product imported from vm amd it is the only record imported

Please take note of the symbol described in first posts as I suspect the import process write all record imported into row 36285 and thus there is no error during import proces . But actuallt the process failed as it only genarated one new product record for 1700+ vm product record
And the hk_id is duplicated for all 1700+ record in the table mentioned above

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #211839

Hi,

Like I wrote in my previous message ; if you're not using the right language table in the VM ; the query to perform the import won't be able to find any complete product and it will failed.
So please check your VM tables like I wrote in my previous message.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 567
  • Thank you received: 11
  • Hikashop Business
9 years 3 months ago #211864

Dear Jerome

i am not sure if you read my written symptoms above, there is at least 1 complete record imported to hikashop product table with id 32685, and genarated 1700+ record in hikashop_vm_product table with hk_id 36285

as i think this is important to find out the cause

For the language table you mentioned, i found a o5hyg_virtuemart_products_en_gb
So what should be check further?

prefix in database
product template

above two option is it important for the import?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 3 months ago #211866

Hi,

In that table, you need to make sure that it has one record for each product of your virtuemart.
The products without an entry in that table won't be imported properly by the system.

The prefix in database is important if your trying to import data from tables with a different prefix than the table prefix configured in your Joomla configuration. That's not the case on your website as far as I understand so you can leave it empty.

The product template option is not relevant to the import from VM so you can leave it empty too.

Please Log in or Create an account to join the conversation.

  • Posts: 567
  • Thank you received: 11
  • Hikashop Business
9 years 3 months ago #211912

Dear Nicolas

Yup, there are 1700+ record in hikashop_vm_product table for my vm_product which is correct, however, all the 1700+ record using the same hk_id which is 32685, and in hikashop product table there is only 1 new row with id 32685

I think this is script problem as i am using the import on 3+ version which did not state supported

Do you mind to share the code where to check so that mayb i can help to make it 3+ support as well

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 3 months ago #211960

Hi,

Ah yes, I had missed that you were migrating from VM3. Indeed VM3 is not supported for now.
It's probably why it doesn't work as the database structure must be different in some way.
The code you want to look at is in the function importProducts in the file administrator/components/com_hikashop/helpers/import/vm2.php

The issue must be with that query:
take.ms/L2qvQ

Please Log in or Create an account to join the conversation.

  • Posts: 567
  • Thank you received: 11
  • Hikashop Business
9 years 2 months ago #212878

Dear Nicolas

Thanks for your location of script, i found that the insert script for hikashop_vm_product using vm_product_sku as key whereby VM3 sku is not a neccessary field

i genarate a random number to all product in virtuemart sku using below
UPDATE `prefix_virtuemart_products` SET `product_sku` =
(SELECT concat(
ELT(FLOOR(1 + (RAND() * (50-1))), 'a','b','c','d','e','f','g','h','i','j','k','l','m ','n','o','p','q','r','s','t','u','v','w','x','y', 'z',
'A','B','C','D','E','F','G','H','I','J','K','L','M ','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z' ),
ELT(FLOOR(1 + (RAND() * (50-1))), 'a','b','c','d','e','f','g','h','i','j','k','l','m ','n','o','p','q','r','s','t','u','v','w','x','y', 'z',
'A','B','C','D','E','F','G','H','I','J','K','L','M ','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z' ),
ELT(FLOOR(1 + (RAND() * (50-1))), 'a','b','c','d','e','f','g','h','i','j','k','l','m ','n','o','p','q','r','s','t','u','v','w','x','y', 'z',
'A','B','C','D','E','F','G','H','I','J','K','L','M ','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z' ),
ELT(FLOOR(1 + (RAND() * (50-1))), 'a','b','c','d','e','f','g','h','i','j','k','l','m ','n','o','p','q','r','s','t','u','v','w','x','y', 'z',
'A','B','C','D','E','F','G','H','I','J','K','L','M ','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z' ),
ELT(FLOOR(1 + (RAND() * (50-1))), 'a','b','c','d','e','f','g','h','i','j','k','l','m ','n','o','p','q','r','s','t','u','v','w','x','y', 'z',
'A','B','C','D','E','F','G','H','I','J','K','L','M ','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z' ),
ELT(FLOOR(1 + (RAND() * (50-1))), 'a','b','c','d','e','f','g','h','i','j','k','l','m ','n','o','p','q','r','s','t','u','v','w','x','y', 'z',
'A','B','C','D','E','F','G','H','I','J','K','L','M ','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z' ),
ELT(FLOOR(1 + (RAND() * (50-1))), 'a','b','c','d','e','f','g','h','i','j','k','l','m ','n','o','p','q','r','s','t','u','v','w','x','y', 'z',
'A','B','C','D','E','F','G','H','I','J','K','L','M ','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z' ),
ELT(FLOOR(1 + (RAND() * (50-1))), 'a','b','c','d','e','f','g','h','i','j','k','l','m ','n','o','p','q','r','s','t','u','v','w','x','y', 'z',
'A','B','C','D','E','F','G','H','I','J','K','L','M ','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z' )
)
) WHERE product_sku="";


However, after the import all product image are showing barcode.png

still finding out and would be appreaciate if you can highlight the cause

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 2 months ago #212879

Hi,

Great. Then, instead of that query, I propose to just change the line:
'product_code' => 'vmp.product_sku',
to:
'product_code' => 'case when vmp.product_sku IS NULL or vmp.product_sku="" then MD5(vmp.product_id) else vmp.product_sku end',
so that the product_code will directly be filled with a random sku based on the md5 of the product_id. A collision of hashes is highly unlikely.

Regarding the images, if you get a barcode, it means that the entry was added in the table hikashop_file for each product, but that the image is missing in the upload folder of HikaShop: media/com_hikashop/upload or images/com_hikashop/upload (you can check the path in the configuration).
A simple solution in that case is to copy the images files from VM to that folder.
This also indicates that the path of the images we get from VM's configuration table by not be valid anymore with VM3:
take.ms/uZJp8

Please Log in or Create an account to join the conversation.

  • Posts: 567
  • Thank you received: 11
  • Hikashop Business
9 years 2 months ago #212904

yup, there are still problem on image import, but are able to correct with minimal efford

VM 3 media table is product or file is always 0 for product

change both line of 'file_path' => 'vmm.file_url', (i manually stripe images/stories/virtuemart/ using sql query)'

and this lead to a success import rfom VM3

The following user(s) said Thank You: Jerome

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 2 months ago #212928

Hi,

Thanks for the report ; it looks like the way that VM store the image in the DB changed again !

Here is a new version of the file administrator/components/com_hikashop/helpers/import/vm2.php which should better handle that if someone comes up with the same issue.

File Attachment:

File Name: vm2.zip
File Size:12 KB



Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Attachments:
Last edit: 9 years 2 months ago by nicolas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum