Data-migration-tool: Magento 2.3.4 data migration table or view not found

Created on 5 Feb 2020  Â·  12Comments  Â·  Source: magento/data-migration-tool

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
acknowledged bug

Most helpful comment

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.

All 12 comments

Hi @PurushothamanKrishnamoorthy

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

@PurushothamanKrishnamoorthy Fixed. Please check if it works for you

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

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 got the same issue as @karlsminton. Do we have a ticket open?

(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

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

[2020-03-13 16:34:57][INFO][mode: data][stage: data migration][step: PostProcessing Step]: started
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?

@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

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

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 notifications@github.com 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
https://github.com/magento/data-migration-tool/issues/791#issuecomment-685783876,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AP7SGK3ODBJ4V4RBMMKTNT3SDZK4FANCNFSM4KQLZ7TQ
.

I got the same error and found out that if you have entered the database name in both
<source> <database host="127.0.0.1" name="lr_shop_dk_db" user="root" password=""/> </source>
and
<source_prefix>lr_shop_dk_db</source_prefix>
it conflicts.
It worked for me after I removed the source and dest prefix.

(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?

Was this page helpful?
0 / 5 - 0 ratings