Skip to content

Magento 2.3.4 data migration table or view not found #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PurushothamanKrishnamoorthy opened this issue Feb 5, 2020 · 12 comments
Closed

Comments

@PurushothamanKrishnamoorthy
Copy link

PurushothamanKrishnamoorthy commented Feb 5, 2020

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
Copy link
Collaborator

Hi @PurushothamanKrishnamoorthy

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

@victor-v-rad
Copy link
Collaborator

@PurushothamanKrishnamoorthy Fixed. Please check if it works for you

@PurushothamanKrishnamoorthy
Copy link
Author

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

@karlsminton
Copy link

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.

@aruntechguy
Copy link

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

@eriknicholas
Copy link

eriknicholas commented Mar 23, 2020

(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
Copy link

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?

@mhafizumer
Copy link

mhafizumer commented Jul 13, 2020

@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
Copy link

peihaochan commented Sep 2, 2020

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
Copy link

mhafizumer commented Sep 2, 2020 via email

@kennethvejen
Copy link

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.

@mhafizumer
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants