Step5 Error Import 30000 import Product 40000 eror

 

I have purchased your paid plugin like Ub Data Migration Pro. And also install magento2 successfully.

I have successfully import categories, customer, sales reports from magento1 to magento2.

However, I am not able to Import Products beyond 30000 products I have apporimately 790000 Products to be imported 
I get an error on Step 5
Step5 error

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 mysql server version for the right syntax to use near ‘and entity_id = 30615 limit 1’ at line 1. the sql statement executed was: select * from `catalog_product_entity_int` `t` where attribute_id = 149 and value = and entity_id = 30615 limit 1
 
Please help us with a solution 
 

5 answers

Profile photo of Mall Staff 111140.00 $tone December 13, 2018
Public

Hi there,

syntax to use near ‘and entity_id = 30615 limit 1’ at line 1. the sql statement executed was: select * from `catalog_product_entity_int` `t` where attribute_id = 149 and value = and entity_id = 30615 limit 1

That issue because your M1’s database has some bad records in table ‘catalog_product_super_attribute_pricing’ (some records has relationship with some records in table ‘eav_attribute_option’ but these was no longer exists) 
To continue with data migration in the step #5 of our migration tool, you could try with steps below:
+ Open the PHP file at path: pub/ub-tool/protected/controllers/Step5Controller.php
and find to the code lines:

foreach ($associatedProductIds as $associatedProductId) {
$strCon1 = "attribute_id = {$attributeId2} AND value = {$optionId2} AND entity_id = {$associatedProductId}";
$eavIntModel2 = Mage2CatalogProductEntityInt::model()->find($strCon1);
if ($eavIntModel2) {
/**
* We will load and update price and special_price
* for related simple products in table catalog_product_entity_decimal
*/
$_attributes = array('price', 'special_price');
foreach ($_attributes as $_attribute) {
$attr2 = UBMigrate::getMage2Attribute($_attribute, $entityTypeId2);
//load and update price value for associated simple product
$strCon2 = "store_id = 0 AND attribute_id = {$attr2->attribute_id} AND entity_id = {$eavIntModel2->entity_id}";
$eavDecimalModel2 = Mage2CatalogProductEntityDecimal::model()->find($strCon2);
if ($eavDecimalModel2) {
if ($_attribute == 'special_price') {
if (!empty($eavDecimalModel2->value)) {
$this->_updateVariationPrice($model->product_id, $_attribute, $eavDecimalModel2, $variation);
}
} else {
$this->_updateVariationPrice($model->product_id, $_attribute, $eavDecimalModel2, $variation);
}
}
}
}
}

and replace it by code lines:

if ($optionId2) {
foreach ($associatedProductIds as $associatedProductId) {
$strCon1 = "attribute_id = {$attributeId2} AND value = {$optionId2} AND entity_id = {$associatedProductId}";
$eavIntModel2 = Mage2CatalogProductEntityInt::model()->find($strCon1);
if ($eavIntModel2) {
/**
* We will load and update price and special_price
* for related simple products in table catalog_product_entity_decimal
*/
$_attributes = array('price', 'special_price');
foreach ($_attributes as $_attribute) {
$attr2 = UBMigrate::getMage2Attribute($_attribute, $entityTypeId2);
//load and update price value for associated simple product
$strCon2 = "store_id = 0 AND attribute_id = {$attr2->attribute_id} AND entity_id = {$eavIntModel2->entity_id}";
$eavDecimalModel2 = Mage2CatalogProductEntityDecimal::model()->find($strCon2);
if ($eavDecimalModel2) {
if ($_attribute == 'special_price') {
if (!empty($eavDecimalModel2->value)) {
$this->_updateVariationPrice($model->product_id, $_attribute, $eavDecimalModel2, $variation);
}
} else {
$this->_updateVariationPrice($model->product_id, $_attribute, $eavDecimalModel2, $variation);
}
}
}
}
}
}

+ Once done, you could continue with data migration in the step #5 of our migration tool by run CLI command:
php -f bin/ubdatamigration run --step=5;
And tell me know how it goes then.
Regards,
Mall.
 

#1
Profile photo of Net Admin 200.00 $tone December 13, 2018
Public

I followed the steps given above by you However It’s not working, I tried doing this through the command line as well 
Given below is the error I am getting 
[ywndev@ywndev2 dev.yeswellness.com]$ php70 -f bin/ubdatamigration run --step=5;
Processing in step #5……………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………PHP Error[2]: Creating default object from empty value
in file /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/controllers/Step5Controller.php at line 1668
#0 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/controllers/Step5Controller.php(242): Step5Controller->_migrateCatalogProductBundleOptions()
#1 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/commands/RunCommand.php(58): Step5Controller->actionRun()
#2 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/commands/RunCommand.php(28): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#9 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /home/ywndev/domains/dev.yeswellness.com/bin/ubdatamigration(4): require_once()
 
 
Kindly Help 
 

#2
Profile photo of Mall Staff 111140.00 $tone December 14, 2018
Public

Hi there,

…PHP Error[2]: Creating default object from empty value
in file /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/controllers/Step5Controller.php at line 1668

It seem you have deleted at least one migrated product or product options after the first migration. To solve that, you could try with steps below:
+ Run below SQL query in your M2 database:

DELETE FROM ub_migrate_map_step_5 WHERE entity_name = 'catalog_product_entity' AND m2_id NOT IN (Select entity_id From catalog_product_entity);
DELETE FROM ub_migrate_map_step_5_product_option WHERE entity_name = 'catalog_product_option' AND m2_id NOT IN (Select option_id From catalog_product_option);
DELETE FROM ub_migrate_map_step_5_product_option WHERE entity_name = 'catalog_product_option_type_value' AND m2_id NOT IN (Select option_type_id From catalog_product_option_type_value);
DELETE FROM ub_migrate_map_step_5_product_option WHERE entity_name = 'catalog_product_option_type_price' AND m2_id NOT IN (Select option_type_price_id From catalog_product_option_type_price);

+ Once done, clean the cache of our migration tool by run command: 
rm -rf pub/ub-tool/protected/runtime/cache/
+ And then, you could continue with data migration in the step #5
Regards,
Mall.

#3
Profile photo of Net Admin 200.00 $tone December 14, 2018
Public

Hi There,
 
I have followed all the steps as mentioned above However I get the same error, We are able to import 7490 products However our Database has approximately 30000 products. Please advice how get rid of this issue, As we need to launch the site ASAP.
 
……………………………………………………………………………………………………………………………………………………..PHP Error[2]: Creating default object from empty value
in file /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/controllers/Step5Controller.php at line 467
#0 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/controllers/Step5Controller.php(153): Step5Controller->_migrateCatalogProducts()
#1 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/commands/RunCommand.php(58): Step5Controller->actionRun()
#2 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/commands/RunCommand.php(28): RunCommand->_migrateData()
#3 unknown(0): RunCommand->actionIndex()
#4 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#5 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#6 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#7 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#8 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#9 /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#10 /home/ywndev/domains/dev.yeswellness.com/bin/ubdatamigration(4): require_once()
 
 
This needs to be Resolved ASAP
Kindly share any your Phone Number so that we can you reach your support team as the turn around time is too much for your reply
 
Thanks 
 
NetADMIN 

#4
Profile photo of Mall Staff 111140.00 $tone December 14, 2018
Public

Hi there,

.PHP Error[2]: Creating default object from empty value
in file /home/ywndev/domains/dev.yeswellness.com/pub/ub-tool/protected/controllers/Step5Controller.php at line 467

That issue cause you have deleted at least one migrated product after first migration. To solve that, let do steps below:
+ Run below SQL query in your M2 database:

DELETE FROM ub_migrate_map_step_5 WHERE entity_name = 'catalog_product_entity' AND m2_id NOT IN (Select entity_id From catalog_product_entity);

+ Once done, clean the cache of our migration tool by run command: 
rm -rf pub/ub-tool/protected/runtime/cache/
(Note: If you enabled PHP memcached, you must reset the PHP memcached)
+ And then, you could continue with data migration in the step #5 by run CLI command:
php -f bin/ubdatamigration run --step=5;
Regards,
Mall.

#5

Please login or Register to Submit Answer

Written By

Comments