How to retain category id

Team,
How to retain the category primarykeys from the old database ?
 
Thanks
Vijay

1 answer

Profile photo of Mall Staff 184060.00 $tone March 14, 2017
Public

Hi there,

How to retain the category primarykeys from the old database ?

Let’s try with steps as bellow:
Open the file at pub/ub-tool/protected/controllers/Step4Controller.php
and find to the code lines:

$category2 = new Mage2CatalogCategoryEntity();
$category2->entity_id = null; //we will not take old entity_id

and replace it by code lines:

$category2 = Mage2CatalogCategoryEntity::model()->find("entity_id = {$category->entity_id}");
if (!$category2) {
$category2 = new Mage2CatalogCategoryEntity();
$category2->entity_id = $category->entity_id;
}

And tell me know how it goes.
Regards,
Mall.

#1

Please login or Register to Submit Answer

Written By

Comments