Hi,
I have a problem with the Delta upgrade with step 5:
2022/02/16 13:45:14 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘889-0’ for key ‘CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION_TYPE_ID_STORE_ID’. The SQL statement executed was: INSERT INTO `catalog_product_option_type_price` (`option_type_id`, `store_id`, `price`, `price_type`) VALUES (:yp0, :yp1, :yp2, :yp3)
In that M2 table `catalog_product_option_type_price` i see that “product_type_ID” with value 889 was added as latest.
See https://prnt.sc/ofIn8M9HEcmD
Can i simply remove that row?
As far as i know i didn’t remove anything. Not using Keep ID’s.
Then continue with php -f bin/ubdatamigration run --step=5; ?
When should i use: “--mode=update” ?
Thanks!
Best Regards,
Wim
7 answers
Hi there,
1062 Duplicate entry ‘889-0’ for key ‘CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION_TYPE_ID_STORE_ID’. The SQL statement executed was: INSERT INTO `catalog_product_option_type_price` (`option_type_id`, `store_id`, `price`, `price_type`) VALUES (:yp0, :yp1, :yp2, :yp3)
That is because your M2 database has a sample or testing data record in the table ‘catalog_product_option_type_price’
and it was a conflict with a record in your M1 database. To handle that case, you can try with steps:
1. Delete the record I mentioned above by running the following SQL in your M2 database:
Delete From catalog_product_option_type_price Where option_type_id = 889 and store_id = 0;
2. Once done, you continue with delta migration in step #5 by running the following CLI command:
php -f bin/ubdatamigration run --step=5
Regards,
Mall.
Hi Mall,
Thanks for the Quick reply.
Ok, i deleted it, also #890 which gave the same error.
After that:
.PHP Error[2]: Creating default object from empty value
in file /data/web/magento2/pub/ub-tool/protected/controllers/Step5Controller.php at line 1427
#0 /data/web/magento2/pub/ub-tool/protected/controllers/Step5Controller.php(1382): Step5Controller->_migrateCatalogProductOptionTypePrice()
#1 /data/web/magento2/pub/ub-tool/protected/controllers/Step5Controller.php(1231): Step5Controller->_migrateCatalogProductOptionTypeValue()
#2 /data/web/magento2/pub/ub-tool/protected/controllers/Step5Controller.php(705): Step5Controller->_migrateCatalogProductOptions()
#3 /data/web/magento2/pub/ub-tool/protected/controllers/Step5Controller.php(187): Step5Controller->_migrateCatalogProducts()
#4 /data/web/magento2/pub/ub-tool/protected/commands/RunCommand.php(80): Step5Controller->actionRun()
#5 /data/web/magento2/pub/ub-tool/protected/commands/RunCommand.php(36): RunCommand->_migrateData()
#6 unknown(0): RunCommand->actionIndex()
#7 /data/web/magento2/pub/ub-tool/yii-1.1.22/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#8 /data/web/magento2/pub/ub-tool/yii-1.1.22/console/CConsoleCommandRunner.php(71): RunCommand->run()
#9 /data/web/magento2/pub/ub-tool/yii-1.1.22/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#10 /data/web/magento2/pub/ub-tool/yii-1.1.22/base/CApplication.php(185): CConsoleApplication->processRequest()
#11 /data/web/magento2/pub/ub-tool/yii-1.1.22/yiic.php(33): CConsoleApplication->run()
#12 /data/web/magento2/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#13 /data/web/magento2/bin/ubdatamigration(4): require_once()
Best Regards,
Wim
Hi there,
.PHP Error[2]: Creating default object from empty value
in file /data/web/magento2/pub/ub-tool/protected/controllers/Step5Controller.php at line 1427
That is another issue. To solve that issue, you can try with steps:
1. Run CLI command:
php -f bin/ubdatamigration clean --step=5
2. And then, you continue with delta migration in step #5:
php -f bin/ubdatamigration run --step=5
Regards,
Mall.
Thats quick! 🙂
i get the first error again, with #895, price_id 1686, some older.
(in the table i see 889 and 890 again)
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘895-0’ for key ‘CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION_TYPE_ID_STORE_ID’. The SQL statement executed was: INSERT INTO `catalog_product_option_type_price` (`option_type_id`, `store_id`, `price`, `price_type`) VALUES (:yp0, :yp1, :yp2, :yp3)
Delete it again and repeat the procedures?
Regards,
Wim
Hi there,
1062 Duplicate entry ‘895-0’ for key
…
Delete it again and repeat the procedures?
Yes, because the issue happened on another value of the ‘option_type_id’.
Regards,
Mall.
Ok, deleted about 10 more rows, now finished 100% 🙂
Have a nice weekend!
Wim
Hi there,
Ok, deleted about 10 more rows, now finished 100%
Yes please continue at your end.
And feel free to contact us if you need further assistance.
Regards,
Mall.