Category settings not migrating correctly

Hi
We are finding that category settings are not migrating correctly from M1 to M2.
For example, a category in M1 is set to display a static block only, but this data has not been migrated over to M2. (This has happened in several categories)
Any ideas?
(This is the 2nd migration I have tried -- the first was the same so I reset and tried again)

8 answers

Profile photo of Mall Staff 153110.00 $tone October 13, 2020
Public

Hi there,

For example, a category in M1 is set to display a static block only, but this data has not been migrated over to M2. (This has happened in several categories)
Any ideas?

Yes, that is right. We reset the value of the ‘Display Mode’ setting to ‘PRODUCTS’ -- Products only.

If you want to keep the original setting of that setting, you can implement with these steps:

1. Open the PHP file at: pub/ub-tool/protected/controllers/Step4Controller.php
and find the code line:

UBMigrate::getMage1AttributeId('display_mode', $entityTypeId) => 'PRODUCTS',

and replace it with:

// UBMigrate::getMage1AttributeId('display_mode', $entityTypeId) => 'PRODUCTS',

2.  Run the following SQL query in your M2 database:

UPDATE `ub_migrate_map_step_4` SET `offset` = 0 Where entity_name = 'catalog_category_entity';

3. And then you run the CLI command:

php -f bin/ubdatamigration run --step=4;

Regards,
Mall.

#1
Profile photo of Mall Staff 153110.00 $tone October 14, 2020
Public

Hi there,

That does update the display mode to static block…but it does not update the desired static block setting??

Yes, that is right. To run delta update for both the ‘Add CMS Block‘ field, you can do as follows:

1. Please make sure that you already checked to migrate the CMS Blocks in step #8: http://prntscr.com/uyv2v5 and make sure you had finished data migration in step #8.

2. Open the PHP file at ‘pub/ub-tool/protected/controllers/Step4Controller.php’
and find the code line:

UBMigrate::getMage1AttributeId('display_mode', $entityTypeId) => 'PRODUCTS',
UBMigrate::getMage1AttributeId('landing_page', $entityTypeId) => '',

and replace it with:

// UBMigrate::getMage1AttributeId('display_mode', $entityTypeId) => 'PRODUCTS',
// UBMigrate::getMage1AttributeId('landing_page', $entityTypeId) => '',

and in that PHP file, you find the code line:

//save/update
if (!$model2->save()) {

and replace it with:

if ($table == 'catalog_category_entity_int') {
$attributeId1 = UBMigrate::getMage1AttributeId('landing_page', $entityTypeId);
if ($model->attribute_id === $attributeId1 && $model->value) {
$model2->value = UBMigrate::getM2EntityId(
'8_cms',
'cms_block',
$model->value
);
}
}
//save/update
if (!$model2->save()) {

2.  Run the following SQL query in your M2 database:

UPDATE `ub_migrate_map_step_4` SET `offset` = 0 Where entity_name = 'catalog_category_entity';

3. And then you run the CLI command:

php -f bin/ubdatamigration run --step=4;

Regards,
Mall.

#3
Profile photo of outrank 50.00 $tone October 14, 2020
Public

Thanks, that looks to have worked.
But why change this functionality in the first place? It doesn’t make sense to me so would be interested in understanding your reasons.
Thanks

#4
Profile photo of ubdev Staff 71680.00 $tone October 15, 2020
Public

Hi there,

would be interested in understanding your reasons.

Upon the current workflow of our module, Migrating Categories will be done first (step #4) and CMS Blocks will follow later on (step #8).
 
Besides, we did not support the migration of CMS Blocks data in the old versions of our module.
 
Regarding the reply #3, the tweaked code in Step 2 was aimed at migrating Category’s Display Mode settings as you want. This data was not migrated under our current workflow. We will consider improving this in the next release of our module.
 
We hope that helps.
 
Regards,
Ubertheme team
 

#5
Profile photo of outrank 50.00 $tone 7 days ago
Public

Thank you,
We have another issue related to category migration (so I am keeping it on the same ticket to assist others who may find it): there is a category attribute that is not being migrated.
The custom attribute is “Footer Content” and it is a textarea for displaying additional content on the category page after the product list.
How can I get this migrated?
Thanks
 

#6
Profile photo of Mall Staff 153110.00 $tone 6 days ago
Public

Hi there,

 The custom attribute is “Footer Content” and it is a textarea for displaying additional content on the category page after the product list.
How can I get this migrated?

That is a custom category’s attribute and it is beyond of support scope of our migration tool. 
Regards,
Mall.

#8

Please login or Register to Submit Answer

Written By

Comments