Data Migration from Magento 1 to Magento 2

Data Migration from Magento 1 to Magento 2
COMMENTS ()
Tweet

magento migration

 

As you know, migration from Magento 1 to Magento 2 comprises of four key areas. These include Data migration, Extensions migration, Theme migration and migration of any customizations. In this post we’ll look at the data migration process. In this tutorial, I’ll be using the data migration tool provided by the Magento community, which is available at https://github.com/magento/data-migration-tool. The Magento versions used in this tutorial are:

  • Magento 1 version 1.9.2.4 (Magento Open Source)
  • Magento 2 version 2.1.5 (Magento Open Source)

Keep in mind that the Magento data migration process does not include the migration of:

  1. Media files on the file system (for e.g., images for products, categories, WYSIWYG editor, etc.)
  2. The store’s frontend design, including cascading style sheets, JavaScript or XML layouts, as these are implemented differently in Magento 2.
  3. Web Services API (SOAP, XML-RPC and REST) credentials and roles.

Preconditions

Before  you begin, you need to make sure that the following steps have been completed.

  • Install and setup the composer.
  • Set up a Magento 2 vanilla website instance and disable all the Cron jobs on it.
  • Check that the data migration tool has a network connection to both the Magento 1 and Magento 2 databases. The data migration tool should also be able to communicate with the databases.

Best Practices for a Successful Data Migration

Before you start the data migration process, stop all Magento 1 Cron jobs.

During the migration process, do not:

1. Make any changes in the Magento 1 Admin area, except for order management (shipping, creating invoice, credit memos, etc.).

2. Alter any code.

3. Make changes in the Magento 2 Admin or store front.

You can carry out all regular operations in your Magento 1 store front though (taking and fulfilling orders, etc.).

Magento 2 Data Migration Sequence

The data migration should carried out in the following manner.

1. Migrate Settings (migrate all stores, websites, and system configuration like shipping, payment and tax settings, etc. According to Magento’s own documentation, it is best practice to migrate the settings first).

2. Migrate Data

3. Migrate Delta Changes (Incremental migration enables you to migrate only the changes made in Magento 1 since the last time data was migrated)

Magento 2 Data Migration Steps

Step 1 – Download and configure the code migration tool

  • To do so, just navigate to the Magento 2 website root directory and run the following command to install the data migration tool.

composer require magento/data-migration-tool:2.1.5

magento migration

Step 2 – Configure the Magento 1 and Magento 2 databases.

  • Navigate to “vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.4”
  • Rename the “config.xml.dist” file to “config.xml”.
  • Configure the database information (as depicted in the code snippet below). The <source> will contain the Magento 1 database, while the <destination> is the Magento 2 database

 

magento migration

  • Configure the “crypt_key” (as shown in the snippet below). The crypt key is located on the following path “<magento1_root_directory>/app/etc/local.xml “ 

 

magento migration

Step 3 – Configure the “settings.xml” in order to migrate settings .

  • Navigate to “vendor/magento/data-migration-tool/etc/ce-to-ce/”
  • Rename the “settings.xml.dist” file to “settings.xml”
  • Copy “the settings.xml” file to “vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.4”
  • In the “config.xml” file , modify the “<settings_map_file>” key tag to the actual path of “settings.xml”
  • Make the changes in the “settings.xml” file as well
  • Launch the migration settings tool from the Magento 2 root directory, by typing in the following command.
php bin/magento migrate:settings "vendor\magento\data-migration-tool\etc\ce-to-ce\1.9.2.4\config.xml" --reset

 

magento migration

Step 4 – Configure “configure.xml” to migrate data.

  • Next, navigate to “vendor/magento/data-migration-tool/etc/ce-to-ce/<magento1_version>/
  • Rename the map.xml.dist file to map.xml.
  • In the config.xml file , update the <map_file> tag key to the full path of “map.xml”

 Similarly, do the same acitivity for all data migration steps given below.

  • Map Step
  • EAV Step
  • Customer Attributes Step
  • Map Step
  • Url Rewrite Step
  • Log Step
  • Ratings Step
  • Configurable Prices step
  • Order Grids Step

Once you’ve done that, launch the migration data tool from the Magento 2 root directory, by typing in the following command.

php bin/magento migrate:data "vendor\magento\data-migration-tool\etc\ce-to-ce\1.9.2.4\config.xml" --reset

 

magento migration

magento migration

TroubleshootingErrors

If you see any of the following error messages, don’t worry, as they are simply referring to either data that’s missing or steps or part of the code which cannot be executed for some reason (the error and the reasons behind them are explained below, for each error).

1. [ERROR]: Source documents are not mapped: folio3_restorecancelled_order

This error simply means that these documents (i.e. the tables) cannot be migrated since they are not part of Magento’s core tables and they need to be ignored in the map.xml. To do that, just add the following code snippet inside the source <document_rules> tag in the map.xml file.

<ignore>
<document>folio3_restorecancelled_order</document>
</ignore>

2[ERROR]: Source fields are not mapped.

Document: sales_flat_quote_item. Fields: orderspro_is_temporary?

This error indicates that these fields (i.e. columns) cannot be migrated, since they are not part of Magento’s core tables and as such, they need to be ignored in map.xml. To do that, just add the following code snippet inside the source’s <field_rules> tag in the map.xml file.

<ignore>
<field>sales_flat_quote_item.orderspro_is_temporary</field>
</ignore>

 

CALL

USA408 365 4638

VISIT

1301 Shoreway Road, Suite 160,

Belmont, CA 94002

Contact us

Whether you are a large enterprise looking to augment your teams with experts resources or an SME looking to scale your business or a startup looking to build something.
We are your digital growth partner.

Tel: +1 408 365 4638
Support: +1 (408) 512 1812