1

I try to migrate a custom table from Magento 1.9 to Magento 2.2. I managed this for some different tables with map.xml and "move". My problem with this table is, that the new version of the module split the data to different tables.

For example: Old Database:

Table 1: id, name, description

New Database:

Table 1: id, name

Table 2: name, description

How can I manage this with map.xml?

Thank you very much.

1
  • can not be done with the data-migration-tool out of the box. Apr 30, 2018 at 16:37

2 Answers 2

1

It cannot done via Data migration as per as my idea.

I suggest to you

create all 3column data on a another table from Magento.

After data-migration,copy data from that table to using MYSQL

Table 1: id, name

Table 2: name, description

It is best solution as per as my idea.

3
  • This could be also be achieved by splitting the tables in the source. And then just let the migration-tool do it's work, you would lose delta-migration though. Apr 30, 2018 at 16:37
  • Please explain brief
    – Amit Bera
    Apr 30, 2018 at 17:10
  • The concept is easy, take a trivial example. Say we have table(M1) subscriptions that has a field subscription_type which is either paid or free. In M2 on the other hand you have paid_subscriptions and free_subscriptions. You would split the subscriptions table, with a query, before the migration into two tables, paid_subscriptions and free_subscriptions based on the subscription_type field. You would totally ignore the subscriptions table with the help of map.xml. Now you let the migration tool run it's course as you achieved 1:1 mapping between tables. You lose the delta migration though. Apr 30, 2018 at 17:34
1

in map.xml

<source>
    ...
    <document_rules>
        <rename>
            <document>table_1</document>
            <to>table_2</to>
        </rename>
    </document_rules>
    ...
    <field_rules>
        ....
        <move>
            <field>table_1.id</field>
            <to>table_1.id</field>
        </move>
        <move>
            <field>table_1.name</field>
            <to>table_1.name</field>
        </move>
        <move>
            <field>table_1.name</field>
            <to>table_2.name</field>
        </move>
        <move>
            <field>table_1.description</field>
            <to>table_2.description</field>
        </move>

Of course, you need to be sure that the tables exist in the right (soruce/destination) databases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.