Step 7 Is not working how do I get pass this error

This is the error I get when I try to run step 7 from terminal

[Processing][run] in step #7: PHP Error[2]: Invalid argument supplied for foreach()
in file /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/protected/controllers/Step7Controller.php at line 775
#0 /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/protected/controllers/Step7Controller.php(184): Step7Controller->_migrateSalesRules()
#1 /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/protected/commands/RunCommand.php(74): Step7Controller->actionRun()
#2 /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/protected/commands/RunCommand.php(33): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#9 /home/dupsgpmy/public_html/magento-temp/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /home/dupsgpmy/public_html/magento-temp/bin/ubdatamigration(4): require_once()
 
If I run it from inside Magento the step just hangs forever and never completes. All the other steps are done I just need to complete this one.

1 answer

Profile photo of Mall Staff 184060.00 $tone June 24, 2020
Public

Hi there,

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

That issue occurred because you did delete at least one migrated Sales Rules after the first migration.

You can try with these steps to solve that issue:
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. Clean the cache of our module by running the command: 
rm -rf pub/ub-tool/protected/runtime/cache/
3. And then, you can continue with the delta migration in step #7 as normal.

Regards,
Mall.

#1

Please login or Register to Submit Answer

Written By

Comments