I tried to migrate data from an old magento (1.9.3.1) to a new magento (2.4.4.1) with the data-migration-tool, it worked fine with the first step (settings migration) but at the second step, migration didn't worked completely, the products were migrated but it made me an error as following :
[2022-07-27T13:11:28.844040+00:00][WARNING]: Could not unserialize data of sales_flat_quote_item_option.value with record id 739865 [2022-07-27T13:11:28.844457+00:00][WARNING]: [2022-07-27T13:11:29.077570+00:00][WARNING]: Could not unserialize data of sales_flat_quote_item_option.value with record id 740231 [2022-07-27T13:11:29.077839+00:00][WARNING]: [2022-07-27T13:11:29.140012+00:00][WARNING]: Could not unserialize data of sales_flat_quote_item_option.value with record id 740312 [2022-07-27T13:11:29.140274+00:00][WARNING]: [2022-07-27T13:11:29.272326+00:00][WARNING]: Could not unserialize data of sales_flat_quote_item_option.value with record id 740537 ....
it wrote this a several times before the mysql server suddenly shutdowns and tells me this :
SQLSTATE[08S01]: Communication link failure: 1053 Server shutdown in progress, query was: SELECT `sales_flat_quote_item_option`.* FROM `sales_flat_quote_item _option` WHERE (`option_id` >= 811251) ORDER BY `option_id` ASC LIMIT 100 In Mysql.php line 90: SQLSTATE[08S01]: Communication link failure: 1053 Server shutdown in progress
i tried to increase the variable innodb_buffer_pool_size into sql but it was not enough to surpass the problem, i don't know how to get around this error, maybe should i increase again the memory allocated to mysql
I hope i can get help here
Thanks
Hello @benjamin_boursault
You can fix this issue by following the below steps:
Change the MySQL max_pocket_size from the MySQL console to 1000000000.
Run below query in MySQL console:
set global net_buffer_length = 1000000; set global max_allowed_packet = 1000000000;
It may help you!
Thank you
Hi @benjamin_boursault ,
Seems you have some wrong custom option data in order table Magento 1 but still not sure.
Do below change and check your data again.
1) Edit below file
src/vendor/magento/data-migration-tool/src/Migration/Handler/SerializeToJson/SalesOrderItem.php
2) Add a try catch around the line which try to unserialize the option_value string in line 81
From:
$optionValue = $option['option_value'] ? unserialize($option['option_value']) : $option['option_value'];
To:
try { $optionValue = $option['option_value'] ? unserialize($option['option_value']) : $option['option_value']; } catch (\Exception $exception) { if (!$this->ignoreBrokenData) { throw new \Exception($exception); } $this->logger->warning(sprintf( 'Could not unserialize data of %s.%s with record id %s', $recordToHandle->getDocument()->getName(), $this->field, $recordToHandle->getValue($this->documentIdFiled->getFiled($recordToHandle->getDocument())) )); $this->logger->warning("\n"); $recordToHandle->setValue($this->field, null); return; }
With this solution you will just not import the custom options that were wrongly serialized in Magento 1
Hope it helps!
Thanks
I've done the both solutions but it still not working maybe because i need to reset the migration like it was the start ? Sadly, i didn't done a back up before to start the migration ;(
There is an other way to rollback at the beginning ?
Thanks
Hi @benjamin_boursault ,
I haven't tried below commands but you can try reset by following below commands.
1) bin/magento migrate:settings --reset
2) bin/magento migrate:data --reset
3) bin/magento migrate:delta --reset
Try with the current step only.
Like if you are doing data migrate and getting error then try to reset only migrate:data step.
Hope it helps!
Thanks
Re
Sadly,
I've got this result :
In Config.php line 70: Invalid config filename: /var/www/html/magento2/vendor/magento/data-migration-tool/etc/config.xml
if i add the config file path then i got a different error :
In Mysql.php line 182: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9-product-details' for key 'eav_attribute_group.EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_A TTRIBUTE_GROUP_CODE'
and i have a question about the code you gave me before for SalesOrderItem.php, the ident of the php code is important or no ?
Thanks for help mate
I've tried this and it still not working fine i've already increase innodb_buffer_pool_size, innodb_buffer_pool_instances, innodb_buffer_pool_chunk_size.
It changed something i guess bc the previous error told
SQLSTATE[08S01]: Communication link failure: 1053 Server shutdown in progress, query was: SELECT `sales_flat_quote_item_option`.* FROM `sales_flat_quote_item _option` WHERE (`option_id` >= 811251) ORDER BY `option_id` ASC LIMIT 5000 In Mysql.php line 90: SQLSTATE[08S01]: Communication link failure: 1053 Server shutdown in progress
and now the limit value is 100
idk what it means
Thanks for help !
I've attempted this it still not working fine i've as of now increment innodb_buffer_pool_size, innodb_buffer_pool_instances, innodb_buffer_pool_chunk_size. It changed something I surmise bc the past mistake told