data-migration-tool
data-migration-tool copied to clipboard
Undefined offset: error at [stage: data migration][step: EAV Step] for Migration from Magento 1.7.0.2 to Magento 2.3.5
Preconditions
- Magento 1.7.0.2 to Magento 2.3.5.p1
- PHP 7.2.28
Steps to reproduce
- In source database, that is Magento 1.7.0.2, select any attribute_id from "catalog_eav_attribute" table
- Now remove row of same attribute_id from table "eav_attribute"
- Execute data migration command
php bin/magento migrate:data -r -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.7.0.2/config.xml or php bin/magento migrate:data -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.7.0.2/config.xml
Expected result
Actual result
- [Screenshot, logs]
Notice: Undefined offset: 144 in /vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php on line 561
Additional notes
I also executed a query
SET SQL_SAFE_UPDATES = 0; DELETE FROM catalog_eav_attribute WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); DELETE FROM eav_entity_attribute WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute); SET SQL_SAFE_UPDATES = 1;
which was given at https://github.com/magento/data-migration-tool/issues/599 and execute data migration command but then after I am getting another error
syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) ORDER BY entity_attribute_id
ASC
LIMIT 160' at line 1, query was: SELECT eav_entity_attribute
.* FROM eav_entity_attribute
WHERE (entity_attribute_id
>= 0) AND (attribute_id IN ()) ORDER BY entity_attribute_id
ASC
LIMIT 160
Attached screenshots for both error.
Hi @skthewebmaster. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
SEE: #https://github.com/magento/data-migration-tool/issues/813
(Restore the database backup you made BEFORE running the data-migration-tool... Using "--reset" or "-r" won't work... You gotta restore the backup each time it fails with this latest version)
cd vendor/magento/
mv data-migration-tool data-migration-tool-bak
git clone https://github.com/magento/data-migration-tool.git
Now copy over your config.xml from the bak to this latest install, and try running the tool again.
@skthewebmaster please also take a look at similar error in https://github.com/magento/data-migration-tool/issues/813 and fix
Hi @KZNcode and @victor-v-rad
Thanks for sharing this link. I made changes to src/Migration/Step/Eav/Data.php as mentioned in https://github.com/magento/data-migration-tool/commit/ea9cc9f21d3634dd3695fd88f9c869d9535cb6a6 and it worked.
Database migrated and products, orders etc. shows in list but when I try to edit product it gives 500 error.
@skthewebmaster
The referred issue #813 was the starting point of many other issues for many - completely unrelated to that because just getting a successful import took several restarts.
Refer to my last comment I added there today for migration resets, and possibly some more ideas.
Unfortunately I cannot assist with error 500, for me I got these errors SOMETHING WENT WRONG
in almost all admin pages.
In my case it was related to the modules Temando, Paypal, and Authorizenet. I cannot remember which one, but as soon as I disabled all those modules, and their related modules, the SOMETHING WENT WRONG
error was gone. I was never able to save anything in the backend before doing this.
This might be completely unrelated to your issue; but you can try.
Hi,
The error 500 was coming from 3 attributes entry in "eav_attribute" database table.
- "preorder",
- "preorderdescript"
- "status_preorder".
I deleted this entries and now I can edit product.
I have also noticed that database from magento 1.7 version has "manufacturer" attribute exist and new magento 2.3.5 also has this attribute "manufacturer" exist in "eav_attribute" database table with same attribute_id but after migration "catalog_product_index_eav" database table has 0 rows in new 2.3.5 database whereas old 1.7.0.2 database has 4656 rows. So this records not migrated.
Thanks