STEP 5 ERROR WHEN run command execute

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

Profile photo of Mall Staff 184060.00 $tone January 16, 2019
Public

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.

#1

Please login or Register to Submit Answer

Written By

Comments