//Magento 2 Extension Migration in 4 Easy Steps
magento 2 extension migration

Magento 2 Extension Migration in 4 Easy Steps

Want to migrate data from Magento 1 to Magento 2?

Want to find simple ways to perform the migration?

But, run into difficulties because of enormous complex data? Then, don’t overlook this article.

Understanding problems that customers face in processing the migration, we provide you the guide on Magento 2 Extension Migration with 4 easy steps.

In addition, several common errors will be identified, thenceforth, find ways to fix things.

(Click for more extensions for Magento)

4 Simple Steps to Complete Magento 2 Extension Migration

magento-2-extension-migration

Soon after Magento 2 was publicly released, Magento 1 has become outdated. Therefore, there are great demands for Magento Extension Migration for the new platform.

Follow these instructions of Magento 2 Extension Migration below and you will find it much simpler.

Getting ready

Similar to version 1, Magento 2 also has bin/magento, which offers many nice commands.

Before anything, please make sure to set the Magento 2 Developer mode and inactivate Full Page Cache (FPC) with:

bin/magento deploy:mode:set developer

Next, with Magento 2, you can easily validate your XML files by shipping with XSD files. Execute this command to integrate directly into PHPStorm:

bin/magento dev:urn-catalog:generate .idea/misc.xml

Complete the preparation and let’s get started!

STEP 1: Create a new skeleton

magento-2-extension-migration-step-1

As Magento 1 is different from version 2, hence, creating a completely new basic structure is necessary.

Execute this and your extension will be installed:

bin/magento module:enable && bin/magento setup:upgrade

STEP 2: Migrate system settings

This step enables you to convert the old system.xml file into the new XSD format in Magento 2.

Moving files to the i18n folder make it much easier to localize files.

STEP 3: Migrate extension logic

In this task, the existing logic from the first version will be migrated with the help of Recolize Recommendation Engine extension:

  • Add layout handles to integrate JavaScript snippet and the Recolize JavaScript parameters
  • Update user information
  • Occasionally generate the product feed

STEP 4: Migrate extension product feed generation

Basically, step 4 is about rewriting some XML stuff into the new format and adapting to the new dependency injection logic.

With the availability of Magento 2 Extension Migration, this step can easily be done.

Common Errors & Solutions

common-errors-solutions

While doing Magento 2 Extension Migration, customers always run into problems as there are too many complicated data.

In this section, we will list out several common errors in processing and also, how to solve them.

#1. Source fields/documents are not mapped

Error:

Source documents are not mapped: <EXTENSION_TABLE> Source fields are not mapped. Document: <EXTENSION_TABLE>. Fields: <EXTENSION_FIELD>

In cases, source fields or documents might not be mentioned. The notification refers to destination ones instead.

Reasons:

Missing of entities in the Magento 2 database.

Solutions:

  • Install the corresponding Magento 2 Extension
  • Use the argument when executing
  • Configure the tool
  • Add the <ignore> tag to an entity in the map.xml file as below:

...
        <document_rules>
            ...
            <!-- Ignore `sales_flat_invoice_grid` table -->
            <ignore>
                <document>sales_flat_invoice_grid</document>
            </ignore>
        </document_rules>
        <field_rules>
            <!-- Ignore `address_id` field of `sales_flat_order_address` table -->
            <ignore>
                <field>sales_flat_order_address.address_id</field>
            </ignore>
            ...
        </field_rules>
    </source>
    ...

#2. Class does not exist but mentioned

Error:

Class <extension/class_name> does not exist but mentioned in: <eav_attribute.frontend_model> for <attribute_id=196>

Reasons:

Unfound a class from the first version in the second one, which belongs to extensions.

Solutions:

  • Install the corresponding Magento 2 Extension
  • Add the attribute to the ignore group in the eav-attribute-groups.xml.dist file
  • Using the class-map.xml.dist file to add class mapping

#3. Foreign key constraint fails

Error:

Orphan records id: <id_1>, <id_2> from <child_table>. <field_id> has no referenced records in <parent_table>.

Reasons:

Database records are missing in the parent_table.

Solutions:

  • If unnecessary, delete the records from the child_table.
  • If keeping, inactivate the Data Integrity Step by modifying the Data Migration Tool’s config.xml.

#4. Duplicates in URL Rewrites

Error:

Request path: towel.html Store ID: 2 Target path: catalog/product/view/id/10 Request path: towel.html Store ID: 2 Target path: catalog/product/view/id/12

Reasons:

  • Specification of the Target path in a URL rewrite
  • Entries that use the same Request path + Store ID pair with two different Target path values

Solutions:

Enable the auto_resolve_urlrewrite_duplicates option in your config.xml file.

#5. Mismatch of entities

Error:

Mismatch of entities in the document: <DOCUMENT> Source: <COUNT_ITEMS_IN_SOURCE_TABLE> Destination: <COUNT_ITEMS_IN_DESTINATION_TABLE>

Reasons:

  • Errors occurrence in Volume Check step
  • Missing records during migration

Solutions:

Run the Data Migration Tool in Delta mode.

#6. Deltalog is not installed

Error:

Deltalog for <TABLE_NAME> is not installed

Reasons:

  • Unfound Deltalog tables (with prefix m2_cl_*) in Magento 1 database
  • Migrating from a copy of live Magento 1 store instead of the live store itself

Solutions:

Test the migration process from a copy of the Magento 1 database.

Conclusion

To sum up, though the migration is extremely complicated to process, however, there’s always room for resolving.

With 4 easy steps in Magento Extension Migration for the second version along with solutions for errors, you can easily master without a doubt.

We hope that this article is helpful enough for you. If you need further support, please comment in the section below. Thanks a lot!

You may also find these interesting: