Hello Ubertheme,
I’m trying to delta migrate step 6 and 7 and at step 7 I get the following error.
app@levjoy-fotonijmegen3-magweb-cmbl:~/magento2$ php -f bin/ubdatamigration run --step=7 --mode=update
Processing in step #7…PHP Error[8]: Trying to get property of non-object
in file /data/web/magento2/pub/ub-tool/protected/controllers/Step7Controller.php at line 669
#0 /data/web/magento2/pub/ub-tool/protected/controllers/Step7Controller.php(198): Step7Controller->_migrateSalesRules()
#1 /data/web/magento2/pub/ub-tool/protected/commands/RunCommand.php(58): Step7Controller->actionRun()
#2 /data/web/magento2/pub/ub-tool/protected/commands/RunCommand.php(28): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /data/web/magento2/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /data/web/magento2/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /data/web/magento2/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /data/web/magento2/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /data/web/magento2/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#9 /data/web/magento2/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /data/web/magento2/bin/ubdatamigration(4): require_once()
18 answers
Hi there,
Processing in step #7…PHP Error[8]: Trying to get property of non-object
in file /data/web/magento2/pub/ub-tool/protected/controllers/Step7Controller.php at line 669
What is the version of our migration tool in your instance?
Regards,
Mall.
Hi Mall,
It’s 3.1.9
Kind Regards
Hi there,
It’s 3.1.9
Lets do steps below to solve the issue you mentioned:
+ Run below SQL 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' 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);
+ Once done, you can continue with data migration in step #7:
php -f bin/ubdatamigration run --step=7
Regards,
Mall.
Hi Mall,
I ran the SQL commands and after that php -f bin/ubdatamigration run --step=7 --mode=update but it did not work.
Processing in step #7…PHP Error[8]: Trying to get property of non-object
in file /data/web/magento2/pub/ub-tool/protected/controllers/Step7Controller.php at line 669
#0 /data/web/magento2/pub/ub-tool/protected/controllers/Step7Controller.php(198): Step7Controller->_migrateSalesRules()
#1 /data/web/magento2/pub/ub-tool/protected/commands/RunCommand.php(58): Step7Controller->actionRun()
#2 /data/web/magento2/pub/ub-tool/protected/commands/RunCommand.php(28): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /data/web/magento2/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /data/web/magento2/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /data/web/magento2/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /data/web/magento2/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /data/web/magento2/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#9 /data/web/magento2/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /data/web/magento2/bin/ubdatamigration(4): require_once()
Hi Mark van Altena,
I ran the SQL commands and after that php -f bin/ubdatamigration run --step=7 --mode=update but it did not work.
My apology, my suggestion had a missing step. You need to clean the cache of our migration tool by running the following command:
rm -rf pub/ub-tool/protected/runtime/cache/
Once done, you can continue with the data migration in step #7 using this command: php -f bin/ubdatamigration run --step=7
(Please note that the ‘update’ mode is not needed at this time)
Regards,
Mall.
Hi Mall,
It ran but with the following error message
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘19671’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote` (`store_id`, `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`, `iosc_subscribe`, `iosc_registered`, `entity_id`, `created_at`, `updated_at`, `base_currency_code`, `store_currency_code`, `quote_currency_code`, `checkout_method`, `customer_tax_class_id`, `customer_email`, `customer_firstname`, `customer_lastname`, `remote_ip`, `applied_rule_ids`, `reserved_order_id`, `global_currency_code`, `base_to_global_rate`, `base_to_quote_rate`, `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, :yp39)
Hi there,
The issue in delta migration should not occur once you complete the removing process, as noted in this ticket. Please follow up with us via that ticket though.
Regards,
Ubertheme team
Hi Ubertheme,
The link does not work.
Kind Regards
Hi Mark van Altena,
The ticket you mentioned is a private one, so you need to log in to view the ticket.
Regards,
Ubertheme team
Hi,
I am logged in.
Kind Regards
Hi Mark van Altena,
Our apology for misinformation. The ticket we mentioned referred to another case.
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘19671’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote` (`store_id`, `is_active`, `is_virtual`, `is_multi_shipping`, `items_count`,
Please try to run the following SQL query in your M2 database:
Delete From quote Where entity_id = 19671;
Once done, continue with the delta migration in step #7:
php -f bin/ubdatamigration run --step=7
(Please note that the ‘update’ mode is not needed at this time)
If the issue still persists, then let us know your site info below:
- URL and admin credentials of your M2 instance
- SSH credentials of your M2 instance
- Let us know the path to your M2 folder.
PS. Please make sure you mark you reply private or switch this ticket to private mode, then it’s safe to share your site info here. Only you and our technical team can access.
Regards,
Mall.
Hi Mall,
Now i got this one
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘26495’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote_item` (`quote_id`, `no_discount`, `weight`, `qty`, `price`, `base_price`, `discount_percent`, `discount_amount`, `base_discount_amount`, `tax_percent`, `tax_amount`, `base_tax_amount`, `row_total`, `base_row_total`, `row_total_with_discount`, `row_weight`, `free_shipping`, `item_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `applied_rule_ids`, `is_qty_decimal`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_applied_amount`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`) 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 Mark van Altena,
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘26495’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote_item` (`quote_id`, `no_discount`, `weight`, `qty`, `price`, `base_price`,
Please continue to run the below SQL in your M2 database:
Delete From quote_item Where item_id = 26495;
Once done, continue with the delta migration in step #7:
php -f bin/ubdatamigration run --step=7
Regards,
Mall.
Hi Mall
For these errors I used the same command and it worked for 26496 but not for 39041.
app@levjoy-fotonijmegen3-magweb-cmbl:~/magento2$ php -f bin/ubdatamigration run --step=7
Processing in step #7………………………………………………………………………………………………
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘26496’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote_item` (`quote_id`, `no_discount`, `weight`, `qty`, `price`, `base_price`, `discount_percent`, `discount_amount`, `base_discount_amount`, `tax_percent`, `tax_amount`, `base_tax_amount`, `row_total`, `base_row_total`, `row_total_with_discount`, `row_weight`, `free_shipping`, `item_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `applied_rule_ids`, `is_qty_decimal`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_applied_amount`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`) 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)
app@levjoy-fotonijmegen3-magweb-cmbl:~/magento2$ php -f bin/ubdatamigration run --step=7
Processing in step #7………………………………………………………………………………………………….
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘39041’ for key ‘PRIMARY’. 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`, `address_id`, `created_at`, `updated_at`, `address_type`, `email`, `firstname`, `lastname`, `street`, `city`, `region`, `region_id`, `postcode`, `country_id`, `telephone`, `shipping_tax_amount`, `base_shipping_tax_amount`, `applied_taxes`, `subtotal_incl_tax`, `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)
Hi Mall,
Can you please help us.
Kind Regards
Hi Mark van Altena,
but not for 39041.
…
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘39041’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `save_in_address_book`, `same_as_billing`,
That issue happened in another data table named ‘quote_address’, thus you can run the following SQL:
Delete From quote_address Where address_id = 39041;
+ Once done, continue with the delta migration in step #7:
php -f bin/ubdatamigration run --step=7
Regards,
Mall.
Hi Mall, Canyou help me with this one
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘33876’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote_payment` (`quote_id`, `cc_exp_year`, `cc_ss_start_month`, `cc_ss_start_year`, `payment_id`, `created_at`, `updated_at`, `method`, `cc_exp_month`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8)
Hi there,
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘33876’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `quote_payment` (`quote_id`, `cc_exp_year`, `cc_ss_start_month`,
Lets run following SQL in your M2:
Delete From quote_payment Where payment_id = 33876;
+ Once done, continue with the delta migration in step #7:
php -f bin/ubdatamigration run --step=7
Regards,
Mall.