Error in migrate sale

Hello people! first of all congratulations for the module, it is amazing! it has been very helpful!
I’m having problems migrating orders, several have already been migrated but an error occurred in the middle of migrating the orders.
CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ”pm725095374br” LIMIT 1′ at line 1. The SQL statement executed was: SELECT * FROM `sales_shipment_track` `t` WHERE parent_id = 16799 AND order_id = 23601 AND created_at = ‘2020-12-04 11:28:20’ AND track_number = ‘pm725095374br” LIMIT 1
Print: https://prnt.sc/O9-nAHipPd8g

5 answers

Profile photo of Mall Staff 178940.00 $tone May 21, 2022
Public

Hi there,

 SELECT * FROM `sales_shipment_track` `t` WHERE parent_id = 16799 AND order_id = 23601 AND created_at = ‘2020-12-04 11:28:20’ AND track_number = ‘pm725095374br” LIMIT 1

That is because there is at least one data record in the table ‘sales_flat_shipment_track’ which has bad data. It seems there is one special char in the string ‘pm725095374br’.
To handle that case you can try with steps as the following:
1. Open the PHP file at path: pub/ub-tool/protected/controllers/Step7Controller.php
and find the code line:

$condition .= " AND track_number = '{$model->track_number}'";

and replace by code lines:

$condition .= " AND track_number = '". addslashes($model->track_number) ."'";

2. Once done, you continue with data migration in step #7 by running the CLI command:

php -f bin/ubdatamigration run --step=7;

Regards,
Mall.
 

#1
Profile photo of Mall Staff 178940.00 $tone May 24, 2022
Public

Hi there,

I’ll continue here with the data migration, thanks!

Yes, please continue and contact me if you need further assistance.
Regards,
Mall.

#3
Profile photo of igorpfc 30.00 $tone May 24, 2022
Public

Hey Mall! I will need your assistance again 🙂
Now, after some time everything running fine, I can see this error now when I run php -f bin/ubdatamigration run --step=7;
 
[Processing][run] in step #7: PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/protected/controllers/Step7Controller.php at line 1879
#0 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/yii-1.1.25/base/CApplication.php(832): CErrorHandler->handle()
#1 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/protected/controllers/Step7Controller.php(1879): CConsoleApplication->handleError()
#2 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/protected/controllers/Step7Controller.php(372): Step7Controller->_migrateActiveQuote()
#3 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/protected/commands/RunCommand.php(80): Step7Controller->actionRun()
#4 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/protected/commands/RunCommand.php(36): RunCommand->_migrateData()
#5 unknown(0): RunCommand->actionIndex()
#6 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/yii-1.1.25/console/CConsoleCommand.php(178): ReflectionMethod->invokeArgs()
#7 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/yii-1.1.25/console/CConsoleCommandRunner.php(71): RunCommand->run()
#8 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/yii-1.1.25/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#9 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/yii-1.1.25/base/CApplication.php(185): CConsoleApplication->processRequest()
#10 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/yii-1.1.25/yiic.php(33): CConsoleApplication->run()
#11 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#12 /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/bin/ubdatamigration(4): require_once()
 
What can it be?

#4
Profile photo of Mall Staff 178940.00 $tone May 24, 2022
Public

Hi there,

[Processing][run] in step #7: PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /home/596413.cloudwaysapps.com/jsrrrkmtfz/public_html/pub/ub-

To solve that issue, you can try with steps:
1. Run CLI command:

php -f bin/ubdatamigration clean --step=7

2. And then, you continue with data migration in step #7:

php -f bin/ubdatamigration run --step=7

Regards,
Mall.

#5

Please login or Register to Submit Answer

Written By

Comments