Data migration: Configurable products after simple

There’s some logic around migrating configurable products which will update product prices of the attached simple products. If the entity_id of the simple product is higher then the configurable product it will be overwritten again by the default price of the product, because of the ordering of the products to be migrated. 
First all simple products should be migrated and then the configurable products should be migrated to set the correct price on the simple products. 

8 answers

Profile photo of Mall Staff 156270.00 $tone October 31, 2020
Public

Hi Danny,

If the entity_id of the simple product is higher then the configurable product it will be overwritten again by the default price of the product, because of the ordering of the products to be migrated. 

Yes, that is not a popular case. We will consider handling that in the next release of our migration tool.

Regards,
Mall.

#1
Profile photo of Mall Staff 156270.00 $tone November 17, 2020
Public

Hi Tommy Bordas,

I think I have the same problem, is a fix on the roadmap ?

If your case is similar to the case mentioned by ‘Danny’:

If the entity_id of the simple product is higher then the configurable product it will be overwritten again by the default price of the product, because of the ordering of the products to be migrated. 

We will consider handling that case in the next version of our migration tool.

Regards,
Mall.

#3
Profile photo of Mall Staff 156270.00 $tone November 18, 2020
Public

Hi Tommy,
For any new question, please help to submit a separate ticket, it will be easier for our team will follow up with you. 

How can I hotfix that now ?

You can try these steps:

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

$orderBy = "entity_id ASC";

and replace it with:

$orderBy = "type_id DESC";

2. Once done, you run the following SQL query in your M2 database:

UPDATE `ub_migrate_map_step_5` SET `offset` = 0 Where entity_name = 'catalog_product_entity';

3. You run data migration in the step #5 using the following CLI command:

php -f bin/ubdatamigration run --step=5

4. And then, reindex the data and clean the M2 cache.
 
We hope that helps. 

Regards,
Mall.

#6
Profile photo of ubdev Staff 73680.00 $tone 3 days ago
Public

Hi Tommy, 
We’re glad that it helped. 
For any additional questions that you might have, please submit a separate ticket, we will follow up with you then. 
PS. Meanwhile, we are offering a special discount for our M2 Extension Bundle with 30%OFF here. This bundle grants you 6 M2 extensions plus 1 theme. Please take a look at it in case you’re interested.  
Regards,
Ubertheme team

#8

Please login or Register to Submit Answer

Written By

Comments