During a migration from Magento 1.9.2.4 to 2.0.7 I noticed that different errors are displayed running the same command:
If i run:
php bin/magento migrate:data -r /var/www/magento2/www.mysite.it/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.3/config.xml
i get:
[PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-Migration_Default' for key 'EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_ATTRIBUTE_SET_NAME'
If i run:
php bin/magento migrate:data --reset /var/www/magento2/www.mysite.it/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.3/config.xml
i get:
[ErrorException]
Undefined offset: 1
Diff : (-r | --reset)
The error appeared after a failed data migration due to this error:
[PDOException]
SQLSTATE[08S01]: Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet' bytes
I solved it and relauched the tool obtaining the Integrity / Offset error.
Is it the same to use -r or --reset?
When I get an error of Integrity violation for duplicate entry during the import:data I have to restore the "empty" magento 2 database and retry or there is another way?
Please, if it's possible, investigate or add explanations to the documentation.
Thank you.
Hi @Dart18
You can use bulk_size option in your config.xml to solve problem with 'max_allowed_packet'
You should restore the initial state of your Magento 2 DB before every attempt of migration unless you got integrity check error.
Run this on the magento 2 site (That has migrated data already presumably), to fix the second issue:
DELETE FROM eav_attribute_set WHERE attribute_set_name != 'Default';
@surfer190 I do not recommend this. This is not the true cause of the problem, it is due to rerunning the EAV step after it has already been ran.
@dfelton Exactly, if you have already done a migration and want to migrate again using -r (reset) you can use this technique. Best case would be to have a magento 2 instance that has not been migrated but I am just saying if that option is not available to you my fix will work.
Hi @Dart18
You can use bulk_size option in your config.xml to solve problem with 'max_allowed_packet'
You should restore the initial state of your Magento 2 DB before every attempt of migration unless you got integrity check error.
What does it mean ? Could you please explain a bit more ?
Most helpful comment
Hi @Dart18
You can use bulk_size option in your config.xml to solve problem with 'max_allowed_packet'
You should restore the initial state of your Magento 2 DB before every attempt of migration unless you got integrity check error.