Hi,
When I try to migrate customers, The ssh show this error:
http://vvcap.com/nvHVOjghCnU
error:
2017/07/18 15:00:17 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘taxvat’ at row 1. The SQL statement executed was: UPDATE `customer_entity` SET `group_id`=:yp0, `store_id`=:yp1, `is_active`=:yp2, `disable_auto_group_change`=:yp3, `failures_num`=:yp4, `entity_id`=:yp5, `website_id`=:yp6, `email`=:yp7, `created_at`=:yp8, `updated_at`=:yp9, `created_in`=:yp10, `firstname`=:yp11, `lastname`=:yp12, `password_hash`=:yp13, `taxvat`=:yp14 WHERE `customer_entity`.`entity_id`=’3843′
Thanks.
9 answers
Hi there,
That issue because your database has some records with bad data in the value of the customer attribute code taxvat . To handle that, you could do following steps:
-- Open the php file at path: ub-tool/protected/controllers/Step6Controller.php
and find to the code line:
$customer2->$attributeCode1 = $model->value;
and replace it by code lines:
$customer2->$attributeCode1 = $model->value;
if ($attributeCode1 == 'taxvat' AND strlen(trim($customer2->$attributeCode1)) > 50) {
$customer2->$attributeCode1 = substr(trim($customer2->$attributeCode1), 0, 50);
}
-- Once done, you can continue with data migration in the step #6.
Regards,
Mall.
Hi there,
The solution worked but now some registers don´t working.
You can see the snap.
http://vvcap.com/tzWKqWqYMED
Thanks, regards.
Hi there,
but now some registers don´t working.
You can see the snap.
http://vvcap.com/tzWKqWqYMED
That because your database has some records which has value with utf8 encoded but seem you have created your magento1 database with other collation (maybe is latin1). To handle that, let’s try do following steps:
Step 1: Run bellow sql in your Magento1 database:
Update customer_entity_varchar set value = convert(binary convert(value using latin1) using utf8);
Step 2: Once done, let’s continue with data migration in the step #6.
And tell me know how it goes.
Regards,
Mall.
Hi,
I have clean tax_vat fields and now it´s work.
Thanks, regards.
Hi there,
Yeah, let’s contact me if you need further assistance.
Regards,
Mall.
Hi there,
We have a problem with a record:
http://vvcap.com/6IJJchpYhNq
We think that the problem is a record with cyrillic character because our database is utf-8
How can I display in log error the incorrect register to be able to modify it?
Are you experiencing another solution?
Thanks, regards.
Hi there,
http://vvcap.com/6IJJchpYhNq
We think that the problem is a record with cyrillic character because our database is utf-8
How can I display in log error the incorrect register to be able to modify it?
That because your database has some records with bad data in the the value of the ‘firstname‘ field in the table ‘sales_flat_quote_address‘.
To detect the entity id with that bad data, you can do following steps:
Open the php file at the path: pub/ub-tool/protected/controllers/Step7Controller.php
and find to the code lines:
/**
* Table: sales_flat_quote_address
*/
$models = Mage1SalesQuoteAddress::model()->findAll("quote_id = {$quoteId1}");
if ($models) {
foreach ($models as $model) {
and replace it by code lines:
/**
* Table: sales_flat_quote_address
*/
$models = Mage1SalesQuoteAddress::model()->findAll("quote_id = {$quoteId1}");
if ($models) {
foreach ($models as $model) {
echo "M1 ID: {$model->address_id}\n"; // this code line help you see the ID in M1
Once done, let continue data migration in the step #7 with cli command:
php -f bin/ubdatamigration run --step=7
And then, you can see the ID of the record with bad data as you want.
Hope this help.
Regards,
Mall.
Hi there!
Perfect. I have found the error.
Thanks, regards.
Hi there,
We have the ticket closed for now. Should you have additional question, kindly reach us here or submit a new ticket.
Regards,
Ubertheme team