Hello, we have this error in step 7:
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\xC4’ for column `mildot2`.`quote_address`.`region` at row 1. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `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`, `fee_amount`, `base_fee_amount`, `address_id`, `created_at`, `updated_at`, `address_type`, `region`, `postcode`, `country_id`, `shipping_method`, `shipping_description`, `shipping_tax_amount`, `base_shipping_tax_amount`, `applied_taxes`, `shipping_discount_amount`, `base_shipping_discount_amount`, `subtotal_incl_tax`, `discount_tax_compensation_amount`, `base_discount_tax_compensation_amount`, `shipping_discount_tax_compensation_amount`, `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, :yp38, :yp39)
How can we solve this?
Thank you.
21 answers
Hi there,
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\xC4’ for column `mildot2`.`quote_address`.`region` at row 1. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `save_in_address_book`, `same_as_billing`,
Please perform the steps below:
+ Run the following SQL query in your M1 database:
Update sales_flat_quote_address set region = convert(binary convert(region using latin1) using utf8);
+ And then, you continue with the data migration in the step #7.
PS. Since our team is off at the weekend, our apology for a certain delay in response if you reach out to us during this time.
Regards,
Mall.
Hello, thank you… now we have this error:
MariaDB [mildot]> Update sales_flat_quote_address set region = convert(binary convert(region using latin1) using utf8);
ERROR 1300 (HY000): Invalid utf8 character string: ‘\xF4ne’
and running step 7 results:
php bin/ubdatamigration run --step=7
[Processing][run] in step #7: PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php at line 1684
#0 /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php(296): Step7Controller->_migrateActiveQuote()
#1 /var/www/mildot2/public_html/pub/ub-tool/protected/commands/RunCommand.php(74): Step7Controller->actionRun()
#2 /var/www/mildot2/public_html/pub/ub-tool/protected/commands/RunCommand.php(33): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#9 /var/www/mildot2/public_html/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /var/www/mildot2/public_html/bin/ubdatamigration(4): require_once()
Hi there,
[Processing][run] in step #7: PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php at line 1684
Please try to run the CLI command:
php -f bin/ubdatamigration rmdeleted --step=7
Next, run the CLI command:
php -f bin/ubdatamigration clean --step=7
And then, continue with the data migration in step #7:
php -f bin/ubdatamigration run --step=7
Regards,
Mall.
It´s getting the same error… or similar:
[Processing][run] Step #7 migration completed with 4 Sales Orders;
PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php at line 1684
#0 /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php(296): Step7Controller->_migrateActiveQuote()
#1 /var/www/mildot2/public_html/pub/ub-tool/protected/commands/RunCommand.php(74): Step7Controller->actionRun()
#2 /var/www/mildot2/public_html/pub/ub-tool/protected/commands/RunCommand.php(33): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#9 /var/www/mildot2/public_html/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /var/www/mildot2/public_html/bin/ubdatamigration(4): require_once()
Hi there,
It´s getting the same error… or similar:
So, please try with these steps:
1. Run the following SQL queries in your M2 database:
DELETE FROM ub_migrate_map_step_7 WHERE entity_name = 'salesrule' AND m2_id NOT IN (Select rule_id From salesrule);
DELETE FROM ub_migrate_map_step_7 WHERE entity_name = 'salesrule_coupon' AND m2_id NOT IN (Select coupon_id From salesrule_coupon);
DELETE FROM ub_migrate_map_step_7_order_item WHERE entity_name = 'sales_flat_order_item' AND m2_id NOT IN (Select item_id From sales_order_item);
DELETE FROM ub_migrate_map_step_7_order_address WHERE entity_name = 'sales_flat_order_address' AND m2_id NOT IN (Select entity_id From sales_order_address);
DELETE FROM ub_migrate_map_step_7_quote WHERE (entity_name = 'sales_flat_quote' OR entity_name = 'sales_flat_quote_active') AND m2_id NOT IN (Select entity_id From quote);
DELETE FROM ub_migrate_map_step_7_quote_item WHERE entity_name = 'sales_flat_quote_item' AND m2_id NOT IN (Select item_id From quote_item);
DELETE FROM ub_migrate_map_step_7_quote_address WHERE entity_name = 'sales_flat_quote_address' AND m2_id NOT IN (Select address_id From quote_address);
2. Remove the cache of our module by running the command:
rm -rf pub/ub-tool/protected/runtime/cache/
3. And then, you continue with the data migration in step #7 as normal.
Regards,
Mall.
Now is returning to first error, invalid datetime:
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\xC4’ for column `mildot2`.`quote_address`.`region` at row 1. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `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`, `fee_amount`, `base_fee_amount`, `address_id`, `created_at`, `updated_at`, `address_type`, `region`, `postcode`, `country_id`, `shipping_method`, `shipping_description`, `shipping_tax_amount`, `base_shipping_tax_amount`, `applied_taxes`, `shipping_discount_amount`, `base_shipping_discount_amount`, `subtotal_incl_tax`, `discount_tax_compensation_amount`, `base_discount_tax_compensation_amount`, `shipping_discount_tax_compensation_amount`, `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, :yp38, :yp39)
Hi there,
1366 Incorrect string value: ‘\xC4’ for column `mildot2`.`quote_address`.`region` at row 1. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `save_in_address_book`, `same_as_billing`,
That because your M1 database has some bad data records in the sales data section. Let’s try with steps as following:
1. Run the following SQL in your M1 database:
Update sales_flat_quote_address set region = convert(binary convert(region using latin1) using utf8);
2. Once done, you continue with data migration in step #7. And tell me to know how it goes.
Regards,
Mall.
Hello, the sql don´t work:
MariaDB [mildot]> Update sales_flat_quote_address set region = convert(binary convert(region using latin1) using utf8);
ERROR 1300 (HY000): Invalid utf8 character string: ‘\xF4ne’
MariaDB [mildot]>
Hi there,
MariaDB [mildot]> Update sales_flat_quote_address set region = convert(binary convert(region using latin1) using utf8);
ERROR 1300 (HY000): Invalid utf8 character string: ‘\xF4ne’
That was because your M1 database had at least one record which had bad data in the value of the ‘region’ field in the ‘sales_flat_quote_address’ table.
Please try with another workaround below:
1. Open the PHP file at pub/ub-tool/protected/controllers/Step7Controller.php
and find the function named: _migrateSalesQuoteAddress(…) {…}
In that function, you find the code line:
if ($model2->save()) {
and then replace it with:
$model2->region = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $model2->region);
if ($model2->save()) {
2. And then, you continue with the data migration in step #7.
Regards,
Mall.
Hello, now we have this error:
magento@beta:~/public_html$ php bin/ubdatamigration run --step=7
[Processing][run] in step #7: PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php at line 1684
#0 /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php(296): Step7Controller->_migrateActiveQuote()
#1 /var/www/mildot2/public_html/pub/ub-tool/protected/commands/RunCommand.php(74): Step7Controller->actionRun()
#2 /var/www/mildot2/public_html/pub/ub-tool/protected/commands/RunCommand.php(33): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#9 /var/www/mildot2/public_html/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /var/www/mildot2/public_html/bin/ubdatamigration(4): require_once()
Hi there,
[Processing][run] in step #7: PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php at line 1684
Please try with these steps:
1. Run the CLI command:
php -f bin/ubdatamigration clean --step=7
2. Then, continue with the data migration in Step #7:
php bin/ubdatamigration run --step=7
Regards,
Mall.
Don´t work, the same error…
Hi there,
Don´t work, the same error…
So, please try with the following steps:
1. Run the SQL queries below in your M2 database:
DELETE FROM ub_migrate_map_step_7 WHERE entity_name = 'salesrule' AND m2_id NOT IN (Select rule_id From salesrule);
DELETE FROM ub_migrate_map_step_7 WHERE entity_name = 'salesrule_coupon' AND m2_id NOT IN (Select coupon_id From salesrule_coupon);
DELETE FROM ub_migrate_map_step_7_order_item WHERE entity_name = 'sales_flat_order_item' AND m2_id NOT IN (Select item_id From sales_order_item);
DELETE FROM ub_migrate_map_step_7_order_address WHERE entity_name = 'sales_flat_order_address' AND m2_id NOT IN (Select entity_id From sales_order_address);
DELETE FROM ub_migrate_map_step_7_quote WHERE (entity_name = 'sales_flat_quote' OR entity_name = 'sales_flat_quote_active') AND m2_id NOT IN (Select entity_id From quote);
DELETE FROM ub_migrate_map_step_7_quote_item WHERE entity_name = 'sales_flat_quote_item' AND m2_id NOT IN (Select item_id From quote_item);
DELETE FROM ub_migrate_map_step_7_quote_address WHERE entity_name = 'sales_flat_quote_address' AND m2_id NOT IN (Select address_id From quote_address);
2. Next, run the command:
rm -rf pub/ub-tool/protected/runtime/cache/
3. Then, you continue with the data migration in step #7
And let me to know how it goes.
Regards,
Mall.
Sorry but now is giving first error again:
php bin/ubdatamigration run --step=7
[Processing][run] in step #7: ………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………….
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\xC4’ for column `mildot2`.`quote_address`.`region` at row 1. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `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`, `fee_amount`, `base_fee_amount`, `address_id`, `created_at`, `updated_at`, `address_type`, `region`, `postcode`, `country_id`, `shipping_method`, `shipping_description`, `shipping_tax_amount`, `base_shipping_tax_amount`, `applied_taxes`, `shipping_discount_amount`, `base_shipping_discount_amount`, `subtotal_incl_tax`, `discount_tax_compensation_amount`, `base_discount_tax_compensation_amount`, `shipping_discount_tax_compensation_amount`, `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, :yp38, :yp39)
Hi there,
Sorry but now is giving first error again:
…
1366 Incorrect string value: ‘\xC4’ for column `mildot2`.`quote_address`.`region`
Did you perform exactly the steps suggested in my reply #9 to handle for that of bad data case? Please check on that once again.
Regards,
Mall.
Yes, It´s modified, in function “_migrateSalesQuoteAddress” in line 2057:
}
}
//$model2->applied_taxes = serialize($appliedTaxes);
$model2->applied_taxes = UbMigrate::encodeJson($appliedTaxes); // this was changed from Magento ver.2.2.0
}
}
//save/update
$model->region = preg_replace(‘/[\x00-\x1F\x80-\xFF]/’, ”, $model->region);
if ($model2->save()) {
if (is_null($m2Id)) {
//update to map log
UBMigrate::log([
‘entity_name’ => $model->tableName(),
‘m1_id’ => $model->address_id,
‘m2_id’ => $model2->address_id,
‘m2_model_class’ => get_class($model2),
‘m2_key_field’ => ‘address_id’,
‘can_reset’ => UBMigrate::RESET_YES,
Hi there,
$model->region = preg_replace(‘/[\x00-\x1F\x80-\xFF]/’, ”, $model->region);
if ($model2->save()) {
My apology, please replace that code lines by the code lines:
$model2->region = preg_replace(‘/[\x00-\x1F\x80-\xFF]/’, ”, $model2->region);
if ($model2->save()) {
And then, you continue with data migration in step #7.
Regards,
Mall.
Now is getting this error:
magento@beta:~/public_html$ php bin/ubdatamigration run --step=7
[Processing][run] in step #7: PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php at line 1684
#0 /var/www/mildot2/public_html/pub/ub-tool/protected/controllers/Step7Controller.php(296): Step7Controller->_migrateActiveQuote()
#1 /var/www/mildot2/public_html/pub/ub-tool/protected/commands/RunCommand.php(74): Step7Controller->actionRun()
#2 /var/www/mildot2/public_html/pub/ub-tool/protected/commands/RunCommand.php(33): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /var/www/mildot2/public_html/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#9 /var/www/mildot2/public_html/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /var/www/mildot2/public_html/bin/ubdatamigration(4): require_once()
Hi there,
Now is getting this error:
magento@beta:~/public_html$ php bin/ubdatamigration run --step=7
[Processing][run] in step #7: PHP Error[8]: Trying to get property ‘attributes’ of non-object
To solve that issue, let’s redo the steps suggested in reply #13.
Regards,
Mall.
Sorry but it´s a loop, again this error:
Modified sql and:
magento@beta:~/public_html$ rm -rf pub/ub-tool/protected/runtime/cache/
magento@beta:~/public_html$ php bin/ubdatamigration run --step=7
[Processing][run] in step #7: ………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………….
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\xC4’ for column `mildot2`.`quote_address`.`region` at row 1. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `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`, `fee_amount`, `base_fee_amount`, `address_id`, `created_at`, `updated_at`, `address_type`, `region`, `postcode`, `country_id`, `shipping_method`, `shipping_description`, `shipping_tax_amount`, `base_shipping_tax_amount`, `applied_taxes`, `shipping_discount_amount`, `base_shipping_discount_amount`, `subtotal_incl_tax`, `discount_tax_compensation_amount`, `base_discount_tax_compensation_amount`, `shipping_discount_tax_compensation_amount`, `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, :yp38, :yp39)
Hi there,
1366 Incorrect string value: ‘\xC4’ for column `mildot2`.`quote_address`.`region` at row 1. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `save_in_address_book`, `same_as_billing`,
That still referred to a bad data case in the value of the field ‘sales_flat_quote_address.region‘ in your M1 database.
Please check again and make sure you did apply the tweaked code in step #7 of our module as suggested in my reply #17.
Regards,
Mall.