Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘51881’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `catalog_product_entity_media_gallery` (`attribute_id`, `media_type`, `disabled`, `value_id`, `value`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4)
1 answer
Hi there,
1062 Duplicate entry ‘51881’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `catalog_product_entity_media_gallery` (`attribute_id`, `media_type`
It seems you have sample product data before performing migration with our migration tool. Please try the steps below:
- Backup your current M2 database
- Delete the records which caused the duplicated issue by running the following SQL in M2 database:
DELETE FROM catalog_product_entity_media_gallery WHERE value_id = 51881;
- Once done, continue with data migration in the step #5 by running the CLI command:
php -f bin/ubdatamigration run --step=5
And let me know how it goes.
Regards,
Mall.