Magento 1 to Magento 2 Migration Process

Posted on January 21st, 2020

Magento has announced that they are going to stop the support for the Magento 1.x platform from June 2020. After the official goodbye of the Magento 1.x platform, those who fail to migrate it to Magento 2 won’t receive any security updates. The three critical components of Magento 1 to Magento 2 migration includes data, Extensions, and themes & customizations.

The steps to migrate Magento 1 to Magento 2 are as follows:

 

1) Setup Magento 2 Instance

1) Download the Magento 2 platform without the sample data.

2) Extract the downloaded data and then follow the setup wizard to install the Magento 2 platform.

3) The setup of Magento 2 with an empty database is complete now. The migrated data gets stored in this database.

 

2) Download the Data Migration Tool

Log in to the root folder of Magento 2 and open the command-line. In the Magento 2 platform, download the data migration from Magento 1 to Magento 2 tool by using the following command.

# composer require Magento/data-migration-tool:<Magento_version>

The version of the data migration tool should be compatible with the Magento 2 codebase. You can check the compatible version in the ‘composer.json’ file under the Magento 2 root directory.

For example, if the Magento version is 2.3.2, then the command would be:

# composer require Magento/data-migration-tool:2.3.2

 

This above command prompts for public and private key for authentication. You can get these keys values by the following steps:

1) Log in to the Magento eCommerce account.

2) After the login, navigate to the “My Accounts” section and click the developer’s link on the left menu.

3) Click on the security keys. Then, locate the public and private key.

You can also download the data migration tool from Github using the link: https://github.com/magento/data-migration-tool.

 

3) Configure the Data Migration Tool

After the installation, you need to set the data migration configuration. Under the ‘data-migration-tool/etc’ folder, you can see the following subfolders.

1) ce-to-ce: This folder contains configuration files and scripts for migrating data from Magento 1 CE (Community Edition) to Magento 2 CE.

2) ce-to-ee: This folder contains configuration files and scripts for migrating Magento 1 CE  to Magento 2 EE (Enterprise Edition).

3) ee-to-ee: If you want to migrate the Magento 1 EE to Magneto 2 EE, then this folder contains the configuration files and scripts for the same.

 

You need to follow the below steps to configure the data migration tool:

1) Enter the directory for which you are performing the migration.

2) Next, enter the directory with the Magento 1 version name. For instance, if you are migrating to Magento version 1.9.4.3, then you should enter the folder name as 1.9.4.3.

3) Make a copy of the ‘map.xml.dist’ file and rename it as ‘map.xml’. Paste the following content in the file.

<source>

<database host=”magento1host” name=”magento1databasename” user=”magento1databaseusername” password=”magento1password” />

</source>

<destination>

<database host=”magento2host” name=”magento2databasename” user=”magento2databaseusername” password=”magento2password” />

</destination>

 

<options>

<source_prefix>magento1tablesprefix</source_prefix>

<dest_prefix>magento2tablesprefix</dest_prefix>

<crypt_key>f3e25abe619dae2387df9fs594f01985</crypt_key>

</options>

4) Then you need to take a copy of the ‘config.xml.dist’ file and rename it to ‘config.xml’. Then open this file and make the following changes to the file:

 

Required Values:

Enter the Magento 1 database details under the source, and in the destination, you need to enter the Magento 2 database details. You can find the ‘Crypt_key’ value in the Magento 1 instance directory at ‘/app/etc/local.xml’ in the tag.

 

Optional Values:

You need to map the database through the mapping file located in the ‘/vendor/Magento/data-migration-tool/etc/’ folder. In this file, you need to change the table names, field names, ignoring tables, and fields and transferring data of the field to the Magento folder. Then you need to remove the .dist extension from the mapping file. In the ‘config.xml’ file, you need to add the following data.

<options>

<map_file>etc/ce-to-ce/1.9.4.3/map.xml</map_file>

<eav_map_file>etc/ce-to-ce/map-eav.xml</eav_map_file>

<eav_document_groups_file>etc/ce-to-ce/eav-document-groups.xml</eav_document_groups_file>

<eav_attribute_groups_file>etc/ce-to-ce/eav-attribute-groups.xml</eav_attribute_groups_file>

<log_map_file>etc/ce-to-ce/map-log.xml</log_map_file>

<log_document_groups_file>etc/ce-to-ce/log-document-groups.xml</log_document_groups_file>

<settings_map_file>etc/ce-to-ce/settings.xml</settings_map_file>

<customer_map_file>etc/ce-to-ce/map-customer.xml</customer_map_file>

<customer_document_groups_file>etc/ce-to-ce/customer-document-groups.xml</customer_document_groups_file>

<customer_attribute_groups_file>etc/ce-to-ce/customer-attribute-groups.xml</customer_attribute_groups_file>

<delta_document_groups_file>etc/ce-to-ce/deltalog.xml</delta_document_groups_file>

<order_grids_document_groups_file>etc/ce-to-ce/order-grids-document-groups.xml</order_grids_document_groups_file>

<map_document_groups>etc/ce-to-ce/map-document-groups.xml</map_document_groups>

<class_map>etc/ce-to-ce/class-map.xml</class_map>

</options>

 

4) Migrate the Websites

You need to migrate the eCommerce store and system configuration like tax settings, payment gateways, shipping, and more. To migrate the website from Magento 1 to Magento 2, you need to run the following command.

# bin/magento migrate:settings [-r|–rest]{}

In the above command, the [-r|–rest] is an optional argument. This argument is used to start the migration from the beginning. The {} is the absolute path to config.xml file.

For example,

sudo bin/magento migrate:settings /var/www/magento2/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.4.3/config.xml

After the migration completes, you need to migrate the data using the following command.

# bin/magento migrate:data [-r|–rest] {}

This above command checks the consistency of tables and fields between Magento 1 and Magento 2. If you want to ignore any tables and fields, then you can add their entries in the map.xml file. Those tables and fields mentioned in the map.xml file do not migrate to Magento 2 database.

After completing the migration, if any new changes have happened in the database, such as new order placed, or new reviews added, then you need to run the following command to migrate that data into the database.

# bin/magento migrate:delta [-r|–rest] {}

After the migration, you need to copy all the media files from Magento 1 to Magento 2. Now you can use the Magento 2 platform for your eCommerce website.

 

If you need any further help, please do reach our support department.

Leave a Reply