Error at start step 7

As soon as I start step 7 deltamigration I get this error:
2017/09/27 16:12:52 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘ruleid’ in ‘where clause’. The SQL statement executed was: SELECT * FROM `salesrule` `t` WHERE ruleid = 3 LIMIT 1
The columname in the databse is rul_id not ruleid. Maybe that is the error??

10 answers

Profile photo of Mall Staff 184060.00 $tone September 27, 2017
Public

Hi there,

….SELECT * FROM `salesrule` `t` WHERE ruleid = 3 LIMIT 1
The columname in the databse is rul_id not ruleid. Maybe that is the error??

Yes, that is right. But why you have that code in step #7 of our tool? Did you customized tool? We don’t use the field named ‘ruleid’ in condition to select salesrule in that context.
Regards,
Mall.

#1
Profile photo of Mall Staff 184060.00 $tone September 28, 2017
Public

Hi there,

This only happens when I run the delta migration

I have re-checked and see that is a issue of our tool in delta mode only. Thanks for your comment. You could do steps as followings to solve that:
-- Open the php file at path: pub/ub-tool/protected/controllers/Step7Controller.php
and find to the code line:

$salesRule2 = Mage2Salesrule::model()->find("ruleid = {$m2Id}");

And replace it by code line:

$salesRule2 = Mage2Salesrule::model()->find("rule_id = {$m2Id}");

Once done, you could do delta migration normally.
Regards,
Mall.

#3
Profile photo of jukebox-revival 2040.00 $tone September 28, 2017
Public

It starts now but after a few seconds I get this error:
Processing in step #7…..PHP Error[2]: Invalid argument supplied for foreach()
in file /home/jukeboxs/public_html/pub/ub-tool/protected/controllers/Step7Controller.php at line 2716
#0 /home/jukeboxs/public_html/pub/ub-tool/protected/controllers/Step7Controller.php(1294): Step7Controller->_migrateSalesOrderItem()
#1 /home/jukeboxs/public_html/pub/ub-tool/protected/controllers/Step7Controller.php(246): Step7Controller->_migrateSalesOrders()
#2 /home/jukeboxs/public_html/pub/ub-tool/protected/commands/RunCommand.php(58): Step7Controller->actionRun()
#3 /home/jukeboxs/public_html/pub/ub-tool/protected/commands/RunCommand.php(28): RunCommand->_migrateData()
#4 unknown(0): RunCommand->actionIndex()
#5 /home/jukeboxs/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#6 /home/jukeboxs/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#7 /home/jukeboxs/public_html/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#8 /home/jukeboxs/public_html/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#9 /home/jukeboxs/public_html/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#10 /home/jukeboxs/public_html/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#11 /home/jukeboxs/public_html/bin/ubdatamigration(4): require_once()
jukeboxs@hosting201 [~/public_html]#

#4
Profile photo of Mall Staff 184060.00 $tone September 28, 2017
Public

Hi there,

Processing in step #7…..PHP Error[2]: Invalid argument supplied for foreach()
in file /home/jukeboxs/public_html/pub/ub-tool/protected/controllers/Step7Controller.php at line 2716

That seem you have manual deleted some records in the table named sales_flat_order_item after the first migration with our tool.
To solve that issue, you could try with steps as followings:
-- Step 1: Run below SQL statement in your Magento2’s database:

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);

-- Step 2: Delete the cache of our tool by command: rm -rf pub/ub-tool/protected/runtime/cache/
-- Step 3: You could continue with data migration in the step #7 of our too.
And tell me know how it goes.
Regards,
Mall.

#5
Profile photo of jukebox-revival 2040.00 $tone September 28, 2017
Public

But now there is another error:
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘69409’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote` (`store_id`, `updated_at`, `is_active`, `is_virtual`, `is_multi_shipping`, `items_count`, `items_qty`, `orig_order_id`, `store_to_base_rate`, `store_to_quote_rate`, `grand_total`, `base_grand_total`, `customer_group_id`, `customer_note_notify`, `customer_is_guest`, `trigger_recollect`, `is_persistent`, `entity_id`, `created_at`, `converted_at`, `base_currency_code`, `store_currency_code`, `quote_currency_code`, `customer_id`, `customer_tax_class_id`, `customer_email`, `customer_firstname`, `customer_lastname`, `remote_ip`, `reserved_order_id`, `global_currency_code`, `base_to_global_rate`, `base_to_quote_rate`, `customer_gender`, `subtotal`, `base_subtotal`, `subtotal_with_discount`, `base_subtotal_with_discount`, `is_changed`) 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)

#7
Profile photo of Mall Staff 184060.00 $tone September 28, 2017
Public

Hi there,

Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘69409’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote` (`store_id`, `updated_at`, `is_active`, `is_virtual`, `is_multi_shipping`, 

Seem your database has existing sales data and you have checked to keeps original ids in the step #7 settings of our tool?
Regards,
Mall.

#8
Profile photo of Mall Staff 184060.00 $tone September 29, 2017
Public

Hi there,

Can I delete 69409 from tabel ‘quote’ and go on? Maybe sombody used the site while we where testing it.

Yes you could do that and continue with data migration.
Regards,
Mall.

#10

Please login or Register to Submit Answer

Written By

Comments