News:

Looking for documentation? Take a look on our wiki

Main Menu

Migration - Keep old category_id's ??

Started by AH, January 27, 2014, 15:49:20 PM

Previous topic - Next topic

AH

Does anyone have a solution to prevent the migration "tool" changing the category ids?


migrator.php

//$category['virtuemart_category_id'] = $oldcategory['category_id'];

Removing this comment allows the creation of:-

virtuemart_categories_en_gb
virtuemart_category_categories
virtuemart_category_medias


But the

virtuemart_categories


Is empty - confused, I am
Regards
A

Joomla 3.10.11
php 8.0

AH

#1
Clearly something in the way the store product model is working

So I created an SQL update to create the missing entries in the virtuemart_category table, you have to run the product conversion separately or it will fail because these entries have not been created.


truncate yourtable_virtuemart_categories;
INSERT INTO yourtable_virtuemart_categories (virtuemart_category_id,virtuemart_vendor_id,ordering,published)
SELECT c.category_id AS virtuemart_category_id, c.vendor_id AS virtuemart_vendor_id, c.list_order AS ordering,
CASE c.category_publish  WHEN 'Y' then 1 ELSE 0
END AS publish

FROM yourtable_vm_category c


I might complete the other fields, but you get the idea!

DONT try and migrate products before you have fixed the missing category entries!!!
You have to run the product migration separately AFTER you have "fixed" the category table using the above SQL
Regards
A

Joomla 3.10.11
php 8.0

mbarry

See my post to http://forum.virtuemart.net/index.php?topic=121624.0 on why this occurring and my solution to problem.

Hope this helps.