magento / data-migration-tool

Magento Data Migration Tool
https://devdocs.magento.com/guides/v2.3/migration/bk-migration-guide.html
Open Software License 3.0
338 stars 199 forks source link

Magento 2.3.4 data migration table or view not found #791

Closed PurushothamanKrishnamoorthy closed 4 years ago

PurushothamanKrishnamoorthy commented 4 years ago

Magento 2 data migration table or view not found without table name

Preconditions

  1. Magento version is 2.3.4 and source magento c1.7.0.2 - community edition
  2. Source and destination db should have prefix

Steps to reproduce

  1. Install and setup Magento 2.3.4
  2. Install and configure Magento migration tool for version 2.3.4
  3. Run migration command for settings and data.

Expected result

  1. Migration should be completed without error. SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mgn' doesn't exist, query was: SELECT COUNT(*) FROM ` mgn`

Actual result

  1. Migration stops after PostProcessing step with following error

Additional notes

  1. mgn_ is the prefix for source and destination data-migration-issue
victor-v-rad commented 4 years ago

Hi @PurushothamanKrishnamoorthy

Thank you for reporting this issue. Internal ticket MC-31156 to process it

victor-v-rad commented 4 years ago

@PurushothamanKrishnamoorthy Fixed. Please check if it works for you

PurushothamanKrishnamoorthy commented 4 years ago

@victor-v-rad Data migration completed successfully. Thanks for the support.

karlsminton commented 4 years ago

I've actioned the fix in the link above and I'm still getting the following error;

82% [======================>-----] Remaining Time: 1 sec In Mysql.php line 110:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'premigrate.enterprise_giftcard_amount' doesn't exist , query was: SELECT COUNT(*) FROM enterprise_giftcard_amount

In Mysql.php line 91:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'premigrate.enterprise_giftcard_amount' doesn't exist

This is especially odd as as I'm using configuration files from opensource-to-commerce.

aruntechguy commented 4 years ago

I got the same issue as @karlsminton. Do we have a ticket open?

eriknicholas commented 4 years ago

(This does not help the previous two comments from aruntechguy nor karlsminton) For the less technical guys (like me): The commit/fix that the [godlike] Victor-V-Rad made on February 5 worked for me. The fix was not applied to the current version of the Data Migration Tool that you currently download (it will be applied to the next update), you still have to manually perform the fix yourself to the file {your-magento-root-directory}/vendor/magento/data-migration-tool/src/Migration/Step/PostProcessing/Data/DeletedRecordsCounter.php Apply the changes indicated here: Change Log/Diff File for Table Prefix Issue Fix Delete the three entire lines in red (lines 95, 96, 97) and copy-paste the 5 lines in green in its place.

My situation: M1.9.2.4 Community Edition/open-source to M2.3.4 CE/opensource

chirag-d-wagento commented 4 years ago

I've actioned the fix in the link above and I'm still getting the following error;

82% [======================>-----] Remaining Time: 1 sec In Mysql.php line 110:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'premigrate.enterprise_giftcard_amount' doesn't exist , query was: SELECT COUNT(*) FROM enterprise_giftcard_amount

In Mysql.php line 91:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'premigrate.enterprise_giftcard_amount' doesn't exist

This is especially odd as as I'm using configuration files from opensource-to-commerce.

I'm getting same error. How you resolved it?

mhafizumer commented 4 years ago

@victor-v-rad I am using magento 2.3.5-p1 and migration tool is 2.3.5, when i run this command php bin/magento -r migrate:data app/code/Vendor/CompanyName/etc/opensource-to-opensource/1.9.3.10/config.xml

Then is give me error SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tildev_test1.eav_attribute_set' doesn't exist, query was: SELECT COUNT(*) FROM eav_attribute_set

It should pick my source_prefic like this tildev_test1.magento1_eav_attribute_set.

Why not it pick my source_prefix ? Even in my config.xml I have add source_prefix

 <options>
        <source_prefix>magento1_</source_prefix>
        <crypt_key>6fac6c90c2774431f1185sadc65d8b98</crypt_key> <options>
</options>

Kindly guide me here I am stuck

peihaochan commented 4 years ago

Hi, I am having the same issue when I run cache:clean,

In Mysql.php line 110:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.core_config_data' doesn't exist, query was: SELECT main_table.* FROM core_config_dat a AS main_table

In Mysql.php line 91:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.core_config_data' doesn't exist

mhafizumer commented 4 years ago

Pei Hao Chan please read carefully tage in config.xml

I was did mistake to add these tags

magento1_ 6fac6c90c2774431f1185sadc65d8b98 in the starting of options tage But I was not read options tage carefully magento itself also add these tags source_prefix and crypt_key at the end of options tag. Just read options Tage in config.xml file, source_prefix and crypt_key tags may be duplicated. Thanks On Wed, 2 Sep 2020 at 19:44, Pei Hao Chan wrote: > Hi, I am having the same issue when I run cache:clean, > > In Mysql.php line 110: > > SQLSTATE[42S02]: Base table or view not found: 1146 Table > 'magento2.core_config_data' doesn't exist, query was: SELECT main_table.* > FROM core_config_dat a AS main_table > > In Mysql.php line 91: > > SQLSTATE[42S02]: Base table or view not found: 1146 Table > 'magento2.core_config_data' doesn't exist > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . >
kennethvejen commented 3 years ago

I got the same error and found out that if you have entered the database name in both `

</source>`

and <source_prefix>lr_shop_dk_db</source_prefix> it conflicts. It worked for me after I removed the source and dest prefix.

mhafizumer commented 3 years ago

(This does not help the previous two comments from aruntechguy nor karlsminton) For the less technical guys (like me): The commit/fix that the [godlike] Victor-V-Rad made on February 5 worked for me. The fix was not applied to the current version of the Data Migration Tool that you currently download (it will be applied to the next update), you still have to manually perform the fix yourself to the file {your-magento-root-directory}/vendor/magento/data-migration-tool/src/Migration/Step/PostProcessing/Data/DeletedRecordsCounter.php Apply the changes indicated here: Change Log/Diff File for Table Prefix Issue Fix Delete the three entire lines in red (lines 95, 96, 97) and copy-paste the 5 lines in green in its place.

My situation: M1.9.2.4 Community Edition/open-source to M2.3.4 CE/opensource

Hi, I am migrate magento 1.9.4.2 to 2.3.4 (open-source to open-source)I am facing the same issue in PostProcessing Step,

error is SQLSTATE[42S02]: Base table or view not found: 1146 Table 'umer_m2walls.magento_giftcard_amount' doesn't exist

image

In open-source there is no any magento_giftcard_amount , this table belong to the commerce Magento version. Why it read commerce version tables?

How to fix it?