Image Position lost on Migration

Hi,
 
we have migrated our products from magento 1 to magento 2.
In Magento 1 we have set the positions for the product images. But they are not being imported to magento 2.
 
Is this a common problem?
 
Please add “max.herber@econsor.de” as recipient to your answer.
 
Thanks in advance!
 
Kind regards,
Max

6 answers

Profile photo of Mall Staff 144590.00 $tone July 31, 2020
Public

Hi Max,

In Magento 1 we have set the positions for the product images. But they are not being imported to magento 2.
 
Is this a common problem?

It seems that it relates to the difference of Magento’s function when showing the images in the images listing. 

You can verify all migrated data records of media images with it’s position in the ‘catalog_product_entity_media_gallery_value‘ table in your M2 database.
 
Regards,
Mall.

#1
Profile photo of ubdev Staff 65720.00 $tone July 31, 2020
Public

Hi Max, 
Our team provides technical support via this helpdesk only, so please follow up with us via this ticket. 
Meanwhile, we’ve just sent over an email regarding your subscription. Please take a look and let us know your feedback there. 
Regards,
Ubertheme team

#2
Profile photo of Mall Staff 144590.00 $tone July 31, 2020
Public

Hi Max,

Is it maybe related, that only one image has a label set?

Yes, it seems that is the root cause of the issue you mentioned. Please try with these steps:

1. Run the following SQL queries in your M2 database:

Delete From catalog_product_entity_media_gallery_value;
Update ub_migrate_map_step_5 Set created_time = '2000-01-01 00:00:00' Where entity_name = 'catalog_product_entity';

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

$con = "value_id = {$model2->value_id} AND store_id = {$storeViewId2} AND label = '" . addslashes($galleryValue->label) . "'";

and replace it with:

$con = "value_id = {$model2->value_id} AND store_id = {$storeViewId2} AND label = '" . addslashes($galleryValue->label) . "'";
$con .= " AND position = {$galleryValue->position}";

3. And then you run the delta migration in step #5 with the ‘update’ mode using this CLI command:

php -f bin/ubdatamigration run --step=5 --mode=update;

And then, check the issue you mentioned again.
 
Regards,
Mall.

#4
Profile photo of ubdev Staff 65720.00 $tone July 31, 2020
Public

Hi Max, 
We’re glad that it helped. 
In case you plan to implement a mega menu or one step checkout feature, please take a look at our M2 extensions here to see if they’re a good fit for you. 
PS. We’d like to offer an exclusive discount for any new purchase you might consider. 
Regards,
Ubertheme team

#6

Please login or Register to Submit Answer

Written By

Comments