Migration of Sales Data failing

Migration of Sales Data failing(Magento 1.8.1 to 2.1.0)
While migrating sales data using the UB Data Migration Pro 2.0.5 I get following error message.
Any ideas what could be the cause and how to fix the issue?
Thanks in advance!
CDbException
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1366 Incorrect string value: ‘\xE2\x80’ for column ‘telephone’ 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`, `address_id`, `created_at`, `address_type`, `email`, `firstname`, `lastname`, `street`, `city`, `region`, `region_id`, `postcode`, `country_id`, `telephone`, `shipping_tax_amount`, `base_shipping_tax_amount`, `applied_taxes`, `subtotal_incl_tax`, `shipping_incl_tax`, `base_shipping_incl_tax`, `free_shipping`) 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)

6 answers

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

Hi jejotuul,

Incorrect string value: ‘\xE2\x80’ for column ‘telephone’ at row 1.

=> That issue occurs because you have bad data with ‘telephone’ field in the table `quote_address` of your Magento 1.
=> To solve that, you can try the solution to fix your Magento2’s database settings here:
http://stackoverflow.com/questions/28973453/mysql2error-incorrect-string-value-xe2-x80-xa8-x09
or:
http://stackoverflow.com/questions/10957238/incorrect-string-value-when-trying-to-insert-utf-8-into-mysql-via-jdbc
Then reset the step 6 and restart the migration in this step.
Meanwhile, please help to provide us your transaction details via info (at) ubertheme.com. We could not keep track of your payment, our system marks an abandoned payment associated with your profile. 
Regards,
Mall.

#1
Profile photo of Fabrice Fetsch 100.00 $tone April 3, 2019
Public

Hi,

i’m facing the same problem (on update data, so the first time this has worked).

Table quote_address does not exist on M1.

M1 table could be : sales_flat_order_quote_address instead.

as it is a quote table, and migrating 100% of the columns is not the most important thing, i decided to NULL all the telephone entries..?

Import then worked.

Hope this will not drive me in pitfall when the store will be live.

#3
Profile photo of ubdev Staff 98150.00 $tone April 4, 2019
Public

Hi Ffab, 
We’d like to clarify further below: 

i’m facing the same problem (on update data, so the first time this has worked).

The issue that Jejotuul mentioned referred to the bad data circumstance. You can either follow the workaround suggested in our reply #1 above or upgrade to the latest Pro version 3.1.9 (which is available for Magento 2.3.1.). 

Table quote_address does not exist on M1.
M1 table could be : sales_flat_order_quote_address instead.

The table ‘quote_address’ belongs to M2. Such table in M1 should be ‘sales_flat_quote_address’ respectively. 
Hope that helps. 
PS. We see you also submitted another ticket here, please follow up further with us there. 
Regards,
Ubertheme team 

#4
Profile photo of mtcmedia 220.00 $tone November 7, 2020
Public

instead i would reccomend do to the following on the magento 1 database ( general— see below for a more detailed step ) .

update sales_flat_quote_address set telephone  = replace(replace ( telephone,unhex("E280AD"),''),unhex("E280AC"),'');

Changing the encoding will not sort anything out or if you change in mysql my.cnf the datails.. that will also not sort anything out.
 
replacing the unhexed data from the error would be the correct way to sort it out. and if you want to see more details about how it looks ( perform the following modifications so that you get the row where the error is: )
in

pub/ub-tool/yii-1.1.22/db/schema/CDbCommandBuilder.php

at the function

createInsertCommand

update

$sql="INSERT INTO {$table->rawName} (".implode(', ',$fields).') VALUES ('.implode(', ',$placeholders).')';

to look something like
 

       echo $sql="INSERT INTO {$table->rawName} (".implode(', ',$fields).') VALUES ('.implode(', ',$placeholders).')';
echo "\n\n\n"; print_r($data);
echo "\n\n\n";

then run the step 7 again to get the error and view the data
and then you can do the following command in SQL:

SELECT  telephone,hex(telephone) from sales_flat_quote_address where quote_id =  [Quote id generated by the error]

then execute the update

update sales_flat_quote_address set telephone  = replace(replace ( telephone,unhex("E280AD"),''),unhex("E280AC"),'') where quote_id= [QUOTE ID FROM ABOVE ERROR / QUERY]

then run the step 7 again and see the miracle happen
 
Oh. And remember to revert the

pub/ub-tool/yii-1.1.22/db/schema/CDbCommandBuilder.php 

back to it’s original state.

#5
Profile photo of ubdev Staff 98150.00 $tone November 9, 2020
Public

Hi mtcmedia,
 
The issue associated with the workaround you shared referred to 1 bad data case in the sales data section in M1. Since the bad data issue varies depending on each instance, it would be best to review on a case-by-case basis.
 
If you find the workaround works for you, you can apply though.
 
Regards,
Ubertheme team

#6

Please login or Register to Submit Answer

Written By

Comments