I get this error

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘4807’ for key ‘PRIMARY’
 
happens in step 7
 
might be two test orders on new server
 
could you help me out?

3 answers

Profile photo of Mall Staff 184060.00 $tone April 28, 2020
Public

Hi Joost,

 1062 Duplicate entry ‘4807’ for key ‘PRIMARY’

That issue occurred because you had either testing or sample data in the sales data section, while you had checked the ‘KEEP ORIGINAL IDs’ setting in step #7 of our module.
 
To continue with the data migration in step #7, you have to delete all sample/testing data objects in the sales data section. You can run the following SQL queries in your M2 database to delete all of them:

Delete From salesrule Where rule_id NOT IN (Select m2_id From ub_migrate_map_step_7 where entity_name = 'salesrule');
Delete From quote Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_7_quote where entity_name = 'sales_flat_quote' OR entity_name = 'sales_flat_quote_active');
Delete From quote_item Where item_id NOT IN (Select m2_id From ub_migrate_map_step_7_quote_item where entity_name = 'sales_flat_quote_item');
Delete From quote_address Where address_id NOT IN (Select m2_id From ub_migrate_map_step_7_quote_address where entity_name = 'sales_flat_quote_address');
Delete From sales_order Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_7_order where entity_name = 'sales_flat_order');
Delete From sales_order_item Where item_id NOT IN (Select m2_id From ub_migrate_map_step_7_order_item where entity_name = 'sales_flat_order_item');
Delete From sales_order_address Where entity_id NOT IN (Select m2_id From ub_migrate_map_step_7_order_address where entity_name = 'sales_flat_order_address');

+ Once done, you can continue with the data migration in step #7.

Regards,
Mall.

#1
Profile photo of ubdev Staff 98150.00 $tone April 29, 2020
Public

Hi Joost, 
We’re glad that it helped. Please continue with the migration process at your end. If you have any additional questions, feel free to get back to us here. 
Regards,
Ubertheme team

#3

Please login or Register to Submit Answer

Written By

Comments