Error

Hi,
 
After the Categories stage, in the “Products” settings for migration, I got the following error:
 
“Error 500
unserialize(): Error at offset 49148 of 49151 bytes”
 
How should I fix it ? 
 
Thanks !

45 answers

Profile photo of Mall Staff 184060.00 $tone December 28, 2017
Public

Hi there,

After the Categories stage, in the “Products” settings for migration, I got the following error:

“Error 500
unserialize(): Error at offset 49148 of 49151 bytes”

Let’s run below SQL statement in your Magento2’s database:

ALTER TABLE `ub_migrate_step` CHANGE `setting_data` `setting_data` LONGBLOB NULL DEFAULT NULL COMMENT 'Settings Data';

And back to step #5 of our tool and tell me know how it goes then.
Regards,
Mall.

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

Hi there,

I runned the SQL query successfully. I flush cache, but the error still remains exactly the same

Let’s try reset the settings in the steps #4, #5 by run CLI commands:
php -f bin/ubdatamigration reset --step=4
php -f bin/ubdatamigration reset --step=5
And back to settings on these steps and tell me know how it goes.
Regards,
Mall.

#3
Profile photo of Mall Staff 184060.00 $tone January 2, 2018
Public

Hi there,

1- It says that “Migrate Customer” has finished, but when I go to check the Migrated Customer I see none. 

To see the customer after migrated, you have to reindex your data. 

2- The migration process has freezed at 71%. I tried to “run all steps” again, but it still get stuck at 71% (731 Sales Orders).

I have checked in back-end of your instance. And i don’t see any error message in the log of our tool. And the latest message log of our tool in the step #7 is:

2017/12/31 08:03:55 -- [Processing] Step #7 migration completed with 100 Sales Orders;
2017/12/31 08:04:02 -- [Processing] Step #7 migration completed with 100 Sales Orders;

Let’s continue with data migration in the step #7 by run cli command:
php -f bin/ubdatamigration run --step=7
Regards,
Mall.

#7
Profile photo of nmella 540.00 $tone January 2, 2018
Public

Thanks !. When I run if from the command line, I get the error:

php -f bin/ubdatamigration run --step=7
Processing in step #7........................................................................................................................................................................................................................................................................PHP Error[2]: include(Mage_Core_Controller_Request_Http.php): failed to open stream: No such file or directory
in file /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/YiiBase.php at line 432
#0 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/YiiBase.php(432): include()
#1 unknown(0): autoload()
#2 unknown(0): spl_autoload_call()
#3 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/controllers/Step7Controller.php(1834): unserialize()
#4 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/controllers/Step7Controller.php(2778): Step7Controller->_convertProductOptions()
#5 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/controllers/Step7Controller.php(1306): Step7Controller->_migrateSalesOrderItem()
#6 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/controllers/Step7Controller.php(246): Step7Controller->_migrateSalesOrders()
#7 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/commands/RunCommand.php(58): Step7Controller->actionRun()
#8 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/commands/RunCommand.php(28): RunCommand->_migrateData()
#9 unknown(0): RunCommand->actionIndex()
#10 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#11 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#12 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#13 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#14 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#15 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#16 /chroot/home/petacl2/peta.cl/html/m2/bin/ubdatamigration(4): require_once()
#8
Profile photo of Mall Staff 184060.00 $tone January 2, 2018
Public

Hi there,
Seem your M1’s database has some records with bad data in the sales data section. Let’s provide me more the SSH credentials.
I will check further and reply you more later.
Regards,
Mall.

#9
Profile photo of Mall Staff 184060.00 $tone January 3, 2018
Public

Hi there,
Please pause all your activities at your end now. I will check further in your instance and reply you more later.
Regards,
Mall.

#13
Profile photo of Mall Staff 184060.00 $tone January 3, 2018
Public

Hi there,
I have checked in your instance and i see the issue as you mentioned. I have added more tweak code in step #7 of our tool to handle for that case. And now you could continue with data migration in the step #7. You could run CLI command:
php -f bin/ubdatamigration run --step=7
I have run for testing: http://i.prntscr.com/LuzQqhlWTvelmXbAEVRTDA.png
Regards,
Mall.

#15
Profile photo of nmella 540.00 $tone January 3, 2018
Public

 Thanks ! What did you do exactly ? What file did you changed ?
Because this is my test migration in my DEV environment. Once I fix all issues, I will proceed with the definitive migration, so I will probably need to do what you just did. 
Thanks. 

#16
Profile photo of Mall Staff 184060.00 $tone January 3, 2018
Public

Hi there,

I will proceed with the definitive migration, so I will probably need to do what you just did. 

Any times, you could download the php file for step #7 of our tool at here
And then, upload replace to the php file in your new instance at path: pub/ub-tool/protected/controllers/Step7Controller.php
Note: This patch only compatible with ver.3.1.2 of our tool.
Regards,
Mall.

#17
Profile photo of nmella 540.00 $tone January 4, 2018
Public

Hi Mall,
Now it has stopped again. Error says:

2018/01/03 05:18:35 [error] [ub_data_migration] Mage2SalesOrder: Total Canceled is too long (maximum is 12 characters).- Total Due is too long (maximum is 12 characters).

What can I do ?
Thanks for the great help !

#18
Profile photo of Mall Staff 184060.00 $tone January 4, 2018
Public

Hi there,

2018/01/03 05:18:35 [error] [ub_data_migration] Mage2SalesOrder: Total Canceled is too long (maximum is 12 characters).- Total Due is too long (maximum is 12 characters).

That because your database has some records has bad data in values of the the sales_flat_order.total_canceled and sales_flat_order.total_due fields.
To solve that issue, you could do with steps as followings:
Step 1: Open the php file at path: pub/ub-tool/protected/controllers/Step7Controller.php
and find to the code line:

'weight','base_grand_total','base_subtotal','grand_total','subtotal',

and replace it by code line:

'weight','base_grand_total','base_subtotal','grand_total','subtotal',total_canceled,total_due,

Once done, you could continue with data migration in the step #7: php -f bin/ubdatamigration run --step=7
Regards,
Mall.

#19
Profile photo of nmella 540.00 $tone January 5, 2018
Public

Thanks. I did (actually I found 2 lines: 1189 and 1256, so I changed on boths), but now I get similar error:

Status: fail
Message: Mage2SalesOrderItem: Price Incl Tax is too long (maximum is 12 characters).<br/>Mage2SalesOrderPayment: Amount Ordered is too long (maximum is 12 characters)

Shoud I add the “Price Incl Tax” variable to the same line ? What is the “Price Incl Tax” variable ?

#20
Profile photo of Mall Staff 184060.00 $tone January 5, 2018
Public

Hi there,

Message: Mage2SalesOrderItem: Price Incl Tax is too long (maximum is 12 characters).
<br/>Mage2SalesOrderPayment: Amount Ordered is too long (maximum is 12 characters)

No, that is another issue in other context. To solve that, you could do with steps as followings:
Open the php file at path: pub/ub-tool/protected/controllers/Step7Controller.php
and find to the code line:

} else if (in_array($key, array('weight', 'row_weight', 'row_total_incl_tax', 'base_row_total_incl_tax')) AND strlen($val) > 12) {

and replace it by code line:

} else if (in_array($key, array('weight', 'row_weight', 'row_total_incl_tax', 'base_row_total_incl_tax', 'price_incl_tax')) AND strlen($val) > 12) {

And then, continue with data migration in the step #7 by run CLI command:
php -f bin/ubdatamigration run --step=7
Regards,
Mall.
 

#21
Profile photo of Mall Staff 184060.00 $tone January 5, 2018
Public

Hi there,

Message: Mage2SalesOrderPayment: Amount Ordered is too long (maximum is 12 characters).

You could check the records with bad data by run below SQL statement in your M1’s database:

SELECT * FROM `sales_flat_order_payment` WHERE LENGTH(`amount_ordered`) > 12;

And re-solve values on that records. And you could continue with data migration then.
Regards,
Mall.

#23
Profile photo of nmella 540.00 $tone January 8, 2018
Public

 Hi Mall,

I had to do everything again….But when I get this error, I don’t know what you did before (I did the same files changes for Step7Controller.php).
What did you do a couple of days ago to solve this issue?

PHP Error[2]: include(Mage_Core_Controller_Request_Http.php): failed to open stream: No such file or directory
in file /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/YiiBase.php at line 432
#0 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/YiiBase.php(432): include()
#1 unknown(0): autoload()
#2 unknown(0): spl_autoload_call()
#3 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/models/UBMigrate.php(2073): unserialize()
#4 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/controllers/Step7Controller.php(1836): mb_unserialize()
#5 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/controllers/Step7Controller.php(2780): Step7Controller->_convertProductOptions()
#6 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/controllers/Step7Controller.php(1308): Step7Controller->_migrateSalesOrderItem()
#7 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/controllers/Step7Controller.php(246): Step7Controller->_migrateSalesOrders()
#8 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/commands/RunCommand.php(58): Step7Controller->actionRun()
#9 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/commands/RunCommand.php(28): RunCommand->_migrateData()
#10 unknown(0): RunCommand->actionIndex()
#11 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#12 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#13 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#14 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#15 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#16 /chroot/home/petacl2/peta.cl/html/m2/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#17 /chroot/home/petacl2/peta.cl/html/m2/bin/ubdatamigration(4): require_once()What did you did before to solve the above issue.
#24
Profile photo of Mall Staff 184060.00 $tone January 8, 2018
Public

Hi there,

What did you do a couple of days ago to solve this issue?

Kindly try with step as followings:
Open the php file at path: pub/ub-tool/protected/models/UBMigrate.php
and find to the code line 2073:

return unserialize($string);

and replace it by code line:

return @unserialize($string);

And tell me know how it goes then.
Regards,
Mall.

#25
Profile photo of nmella 540.00 $tone January 8, 2018
Public

Hi, 
Migration when 100%. Thanks!
 
Now, I can’t login using the same credentials (login & password) from magento 1….
 
All customers were migrated successfully.
 
What might be wrong ?
 
Thanks again.

#28
Profile photo of Mall Staff 184060.00 $tone January 9, 2018
Public

Hit here,

Now, I can’t login using the same credentials (login & password) from magento 1….
All customers were migrated successfully.
What might be wrong ?

Did you select the Merge default website option in the step #2 of our tool? (It seems you have changed the URL of your M2 instance, I couldn’t access http://m2.peta.cl/admin_1r0bk7/ now)
If you haven’t select the Merge default website option, you need to set the migrated website as default website in your M2’s instance now. And then, the migrated customers belong to migrated website can login in your M2 instance normally. Please check this again via the back-end of your M2 instance now.
Regards,
Mall.

#29
Profile photo of Mall Staff 184060.00 $tone January 10, 2018
Public

Hi there,
I have checked login with the customer credentials you provided and i see the issue as you said.
I have checked more in back-end of your instance and i see there are some strange:
I couldn’t view customer’s information in back-end: http://i.prntscr.com/N8pL08qwQPqfS7nRmX5ESw.png
Do you see that issue in the first time?
Also, our tool detected in your M1’s database has Total: 34858 customers -- https://prnt.sc/hycq20
But in the quick report of our tool there are total migrated 35028 customers: https://prnt.sc/hycqcq
But now i see total 35027 customers in gridview in back-end of your M2: https://prnt.sc/hycqgq
That are strange, could you explain more information about that? What did you do with your data after migration with our tool?
Regards,
Mall.
 

#33
Profile photo of nmella 540.00 $tone January 11, 2018
Public

Thanks. 
I haven’t done anything….so it is very strange. I can’t explain…. I only have worked on the migration tool test. 
I will install a new M2 instance, and try again the migration process. I’ll let you know if the login & password error persists. 

#34
Profile photo of Mall Staff 184060.00 $tone January 12, 2018
Public

Hi there,

I will install a new M2 instance, and try again the migration process. I’ll let you know if the login & password error persists. 

Yeah, let’s try with that step and contact me if you need further assistance.
Regards,
Mall.

#35
Profile photo of nmella 540.00 $tone March 1, 2018
Public

Hi there !
 
Migration was great so far. But now I have an issue when editing the Category of a product. I get the following error:
 

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`petacl2_m2`.`catalog_url_rewrite_product_category`, CONSTRAINT `FK_BB79E64705D7F17FE181F23144528FC8` FOREIGN KEY (`url_rewrite_id`) REFERENCES `url_rewrite2` (`url_rewrite_id`) ON DELETE CASC), query was: INSERT INTO `catalog_url_rewrite_product_category` (`url_rewrite_id`,`category_id`,`product_id`) VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)

This happens when I try to edit a Product from the Backend Catalog Page, and I add a Category to the Product. After saving, I get the above error.
This issue is similar to mine (upgrade from 1.9 to 2.1) …and it seems it is related to the product migration process.
Appreciate your help. 
Thanks !

#36
Profile photo of Mall Staff 184060.00 $tone March 2, 2018
Public

Hi there,

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`petacl2_m2`.`catalog_url_rewrite_product_category`, CONSTRAINT `FK_BB79E64705D7F17FE181F23144528FC8` FOREIGN KEY (`url_rewrite_id`) REFERENCES `url_rewrite2` (`url_rewrite_id`) ON DELETE CASC), query was: INSERT INTO `catalog_url_rewrite_product_category` (`url_rewrite_id`,`category_id`,`product_id`) VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)

I have checked further about that issue in your Magento2’s database and see a strange issue in your M2’s database now: http://i.prntscr.com/WkO8rb1KQEeka-sWKu7TkQ.png
As seen in the screenshot, there are two strange tables: url_rewrite2 and url_rewrite3 
Regarding the issue you mentioned, it referred to a Foreign Key in the table catalog_url_rewrite_product_category which relates to the table named url_rewrite2
Upon standard Magento 2 database structure, there’s only one table named ‘url_rewrite’ to store url rewrite. Could you explained why your M2’s database has two additional tables url_rewrite2 and url_rewrite3?

Also, I see there are a lot of products which were not migrated by our tool in your M2’s instance now:
http://i.prntscr.com/Fs9FrJ4YQeWE4kOKchYXmQ.png
So, did you use another tool or methods to migrate your data on this Magento 2 instance?
I will help to check further once knowing more details for the points above.
Regards,
Mall.
 
 

#37
Profile photo of nmella 540.00 $tone March 2, 2018
Public

Hi Mall,
 
I don’t know how does table appeared ( url_rewrite2,  url_rewrite3). I guess the developer that help me maybe wanted to make a backup…but I am not really sure. 
After migrating all products from M1 to M2, I deleted a huge amount in the M2 instance of unwanted products. I just “removed” old products.

#38
Profile photo of Mall Staff 184060.00 $tone March 3, 2018
Public

Hi there,

I don’t know how does table appeared ( url_rewrite2,  url_rewrite3). I guess the developer that help me maybe wanted to make a backup…but I am not really sure. 

So, you should consider to retry with steps as followings:
Step 1: Install a new Magento 2 fresh instance.
Step 2: Install our tool and do data migration with steps as our guide in the Readme.html
Step 3:  Verify the migrated data.
And tell me know how it goes.
Regards,
Mall.

#39
Profile photo of nmella 540.00 $tone March 3, 2018
Public

Hi,
 
I can’t do that. I already have the migrated site in production….
No other choice ? Maybe dropping the url_rewrite2 and url_rewrite3 tables ?
 
Thanks. 

#40
Profile photo of Mall Staff 184060.00 $tone March 3, 2018
Public

Hi there,

No other choice ? Maybe dropping the url_rewrite2 and url_rewrite3 tables ?

So, you should discus more with your developers to get more information about that tables. And you could see in the error message:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`petacl2_m2`.`catalog_url_rewrite_product_category`, CONSTRAINT `FK_BB79E64705D7F17FE181F23144528FC8` FOREIGN KEY (`url_rewrite_id`) REFERENCES `url_rewrite2` (`url_rewrite_id`) ON DELETE CASC), query was: INSERT INTO 

There is one FOREIGN KEY in the table ‘catalog_url_rewrite_product_category‘ references to the table ‘url_rewrite2
And that is a strange.
Regards,
Mall.

#41
Profile photo of nmella 540.00 $tone March 8, 2018
Public

Hi,
Can I remove the “pub/ub-tool” ? 
I already finished successfully our migration, so I would like to uninstall the module. Is there an uninstallation guide ?
Thanks !

#42
Profile photo of ubdev Staff 98150.00 $tone March 8, 2018
Public

Hi there, 
We wonder if you plan to proceed delta migration later on? 
If you have our migration tool uninstalled, you can not proceed delta migration at a later phase. 
Anyway, you can find steps below to uninstall our UB Data Migration Pro:  
(NOTE: If you just want to disable our migration tool, you just need do the Step 1)
 
Step 1: Disable our tool by run cli command: php -f bin/magento module:disable -c Ubertheme_Ubdatamigration
 
Step 2: Run followings SQL statements in your Magento2 database:
DELTE FROM setup_module WHERE module = ‘Ubertheme_Ubdatamigration’;
DROP TABLE IF EXISTS ub_migrate_map_step_2,ub_migrate_map_step_3,ub_migrate_map_step_3_attribute,ub_migrate_map_step_3_attribute_option,ub_migrate_map_step_4,ub_migrate_map_step_5,ub_migrate_map_step_5_product_download,ub_migrate_map_step_5_product_option,ub_migrate_map_step_6,ub_migrate_map_step_6_customer_address,ub_migrate_map_step_7,ub_migrate_map_step_7_invoice,ub_migrate_map_step_7_invoice_item,ub_migrate_map_step_7_order,ub_migrate_map_step_7_order_address,ub_migrate_map_step_7_order_item,ub_migrate_map_step_7_quote,ub_migrate_map_step_7_quote_address,ub_migrate_map_step_7_quote_item,ub_migrate_map_step_8,ub_migrate_map_step_8_downloadable_link_purchased,ub_migrate_map_step_8_rating,ub_migrate_map_step_8_review,ub_migrate_map_step_8_review_summary,ub_migrate_map_step_8_subscriber,ub_migrate_step;
 
Step 3: Open your Terminal, go to your web root folder and run below cli commands to clean source code of our tool:
rm -rf app/code/Ubertheme/Ubdatamigration pub/ub-tool/
 
Regards,
Ubertheme team

#43
Profile photo of ubdev Staff 98150.00 $tone March 9, 2018
Public

Hi there, 
Glad we can help. 
We have this ticket closed for now. If you have any additional question, please submit a new ticket or reach us here. 
Regards,
Ubertheme team

#45

Please login or Register to Submit Answer

Written By

Comments