can not migrate the order data with delta migratio

it is fail When transferring order data from magento1. it shows 
php -f bin/ubdatamigration run --step=7 --mode=update
Processing in step #7…
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Dup licate entry ’44’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `salesrule` (`uses_per_customer`, `is_active`, `stop_rules_processing`, `is_advanced`, `sort_order`, `discount_amount`, `discount_step`, `apply_to_ shipping`, `times_used`, `is_rss`, `coupon_type`, `use_auto_generation`, `uses_per_coupon`, `simple_free_shipping` , `rule_id`, `name`, `description`, `from_date`, `conditions_serialized`, `actions_serialized`, `simple_action`) V ALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9, :yp10, :yp11, :yp12, :yp13, :yp14, :yp15, :yp16 , :yp17, :yp18, :yp19, :yp20),
this is the the delta migration.

Thank you so much.

  1. Profile photo of david elecrowdavid elecrow -10.00 $tone July 26, 2019
    after I delete the sales rule (which has the rule_id = 44) in the mage2, it show another error--Status: failMessage: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xE9' for column 'city' at row 1. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `updated_at`, `save_in_address_book`, `same_as_billing`, `collect_shipping_rates`, `weight`, `subtotal`, `base_subtotal`, `subtotal_with_discount`, `base_subtotal_with_discount`, `tax_amount`, `base_tax_amount`, `shipping_amount`, `base_shipping_amount`, `discount_amount`, `base_discount_amount`, `grand_total`, `base_grand_total`, `free_shipping`, `created_at`, `customer_id`, `customer_address_id`, `address_type`, `email`, `firstname`, `lastname`, `street`, `city`, `region`, `postcode`, `country_id`, `telephone`, `shipping_tax_amount`, `base_shipping_tax_amount`, `applied_taxes`, `subtotal_incl_tax`, `shipping_incl_tax`, `base_shipping_incl_tax`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9, :yp10, :yp11, :yp12, :yp13, :yp14, :yp15, :yp16, :yp17, :yp18, :yp19, :yp20, :yp21, :yp22, :yp23, :yp24, :yp25, :yp26, :yp27, :yp28, :yp29, :yp30, :yp31, :yp32, :yp33, :yp34, :yp35, :yp36, :yp37)

3 answers

Profile photo of Mall Staff 184060.00 $tone July 26, 2019
Public

Hi David,

General error: 1366 Incorrect string value: ‘\xE9’ for column ‘city’ at row 1. The SQL statement executed was: INSERT INTO `quote_address` 

That issue was because your M1 database had bad data in the value of ‘city’ field in the table ‘sales_flat_quote_address’. You can run the below SQL in your M1 database to list that bad record at your end:

Select city from sales_flat_quote_address where city regexp '[^ -~]';

And then, you can run the following SQL in your M1 database to fix that bad data record:
 

Update sales_flat_quote_address set city = convert(binary convert(city using latin1) using utf8);

+ Once done, you can continue with the data migration in the step #7 by running the command:
php -f bin/ubdatamigration run --step=7;

Regards,
Mall.

#
Profile photo of Mall Staff 184060.00 $tone July 26, 2019
Public

Hi David,

Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Dup licate entry ’44’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `salesrule` (`uses_per_customer`, `is_active`, `stop_rules_processing`, 

That issue occurred because you checked the ‘KEEP ORIGINAL IDs’ setting in the step #7 of our migration tool, while  your M2 had at least one sales rule added before data migration.
 
To continue with the ‘KEEP ORIGINAL IDs’ option, you need to delete the sales rule (which has the rule_id = 44) added in M2.
 
Once done, you can continue with the data migration in step #7 by running the command:
php -f bin/ubdatamigration run --step=7
 
Regards,
Mall.
 

#1
Profile photo of ubdev Staff 98130.00 $tone July 26, 2019
Public

Hi David, 
For any new question you might have, please help to add a new reply, instead of posting under the comment section of your original question. It’s hard for us to follow up your questions in the comment section.
Regards,
Ubertheme team

#2

Please login or Register to Submit Answer

Written By

Comments