data-migration-tool icon indicating copy to clipboard operation
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

Open skthewebmaster opened this issue 4 years ago • 6 comments

Preconditions

  1. Magento 1.7.0.2 to Magento 2.3.5.p1
  2. PHP 7.2.28

Steps to reproduce

  1. In source database, that is Magento 1.7.0.2, select any attribute_id from "catalog_eav_attribute" table
  2. Now remove row of same attribute_id from table "eav_attribute"
  3. 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

  1. [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. eav_error eav_error2

skthewebmaster avatar May 23 '20 10:05 skthewebmaster

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


m2-assistant[bot] avatar May 23 '20 10:05 m2-assistant[bot]

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.

KZNcode avatar May 25 '20 05:05 KZNcode

@skthewebmaster please also take a look at similar error in https://github.com/magento/data-migration-tool/issues/813 and fix

victor-v-rad avatar May 26 '20 13:05 victor-v-rad

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 avatar May 26 '20 14:05 skthewebmaster

@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.

ChameleonDevil avatar May 27 '20 15:05 ChameleonDevil

Hi,

The error 500 was coming from 3 attributes entry in "eav_attribute" database table.

  1. "preorder",
  2. "preorderdescript"
  3. "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

skthewebmaster avatar Jun 01 '20 10:06 skthewebmaster