How to Migrate From Magento 1 to Magento 2 Without Breaking Anything on Your Store

by Fayyaz Khattak  May 1, 2017

The support for Magento 1 will end next year. Already the best minds in the ecommerce development industry are focused on making Magento 2 a successful ecommerce platform.

migrate from magento 1 to magento 2

This is what Ben Marks, Evangelist at Magento, tweeted about the sunset of Magento 1:

Paul Boisvert, head of Product Management at Magento, also verified the information and said that November 18th, 2018 is the exact date when the world will bid Magento 1 an official goodbye with 3 years of End-of-Life (EOL) warning to store owners.

Given all this, it is very important that store owners should start planning the migration from Magento 1 to Magento 2 as soon as possible. If you are planning on moving over to Magento 2, continue reading this blog post because today, I am going to give you a detailed overview of the migration process.

Before starting the actual migration process, consider the following recommendations:

  • Make a full backup of your Magento 1 store including all files, folders, and the database.
  • Create a clone of your Magento 1 store. Do not use the live store for the migration process.
  • Analyze your store. Keep what you think is necessary and delete the rest.
  • Check whether your current theme(s), extensions and custom code are compatible with the Magento 2.
  • Migrate the data from the cloned database of your Magento 1 store.
  • Remove outdated and useless data from the database. This includes logs, recently viewed products, compared products, etc.
  • To make the migration process as hassle free as possible, install a fresh copy of Magento 2 on the same hosting server where your Magento 1 store is located.

According to the official Magento documentation, migration to the Magento 2 consists of four different stages:

  1. Theme Migration
  2. Extension Migration
  3. Customizations
  4. Data Migration

Theme Migration

Magento 2 introduces new methodologies and technologies for delivering enhanced shopping and store experience to the merchants and users. Developers can take advantages of new ways of creating awesome Magento 2 themes or modify the current ones to make them compatible with the Magento 2 standards. You should keep in mind that you cannot directly migrate your Magento 1 theme to Magento 2.

You have to create a new theme for Magento 2 and make it responsive for the best user experience. To help you with this, I have written an easy-to-follow article on how to create a custom theme in Magento 2.

If you wish to avoid all this hassle, buy and install a Magento 2 theme from the Magento Marketplace or from other reputed sources.

Extension Migration

Extensions are essential components that provide new features and extend the functionalities of your Magento store. The next step in the migration process is to install the desired Magento 2 extensions available on Magento Marketplace.

Remember that, Magento 1 extensions will not work on Magento 2. You will experience severe compatibility issues while integrating Magento 1 extensions into Magento 2.

Only install the relevant extensions that are available and required for your Magento 2 stores. The Magento developers, community and development agencies are still working hard on porting Magento 1 extensions to Magento 2.

If you want to do it on your own, and want to learn more about Magento 2 extension development, please have a look at my how to create Magento 2 extension blog post.

Customization

In many cases, the custom code used by your Magento 1 store is compatible with Magento 2. Magento offers a Code Migration Toolkit that helps you in this process. It should be noted here that due to structural differences in the two platforms, this migration may require additional work to make sure that the custom code successfully integrates with the Magento 2 store.

To know more about the integration, visit the GitHub repository of Magento Code Migration Toolkit.

Data Migration

The last action you need to perform during the migration process is moving your Magento 1 settings and data to Magento 2. Magento provides a Magento 2 Data Migration Tool which makes the migration process hassle free. This fantastic tool helps in migrating critical data (products, categories, orders, store configurations & settings, etc.) to Magento 2.

To perform a successful data migration, follow these guidelines:

Install Data Migration Tool via Composer

To install this tool, make sure that the version of Magento 2 and Data Migration Tool matches exactly. For instance, if you are using Magento v2.1.2, you must install Data Migration Tool v2.1.2. In general, If you are using the latest version of Magento 2, you have to use the most recent version of Data Migration Tool.

To find the version of your Magento 2, navigate to the root directory of your Magento 2 via SSH terminal and enter the following command:

Now, once you know the version of your Magento 2 store, it is time to install the Data Migration Tool. Keep in mind that you must update the location of the Data Migration Tool package in the composer.json file, located in the Magento 2 root directory. Run the following commands to carry out this job:

In the above CLI command, <version> refers to the version of Data Migration Tool which must match with the Magento 2 version discovered earlier.

For instance, if you are using Magento 2.1.2, enter:

You will be asked to enter your authentication keys. Go to Magento Marketplace. Sign in using your login credentials, and then click My Access Keys. If you already have keys, your public key is your username and the private key is your password. Otherwise, create a new key pair by clicking the Create a New Access Key button.

In few seconds, the Data Migration Tool will be successfully installed on your Magento 2 store.

Configure Data Migration Tool

After the installation, the following directories will contain mapping and configuration files for the Data Migration Tool:

<Magento 2 root dir>/vendor/magento/data-migration-tool/etc/ce-to-ce

contains configuration and scripts for migrating from Magento 1 Community Edition to Magento 2 Community Edition, and

<Magento 2 root dir>/vendor/magento/data-migration-tool/etc/ce-to-ee

contains configuration and scripts for migrating from Magento 1 Community Edition to Magento 2 Enterprise Edition, and

<Magento 2 root dir>/vendor/magento/data-migration-tool/etc/ee-to-ee

contains configuration and scripts for migrating from Magento 1 Enterprise Edition to Magento 2 Enterprise Edition.

Before you migrate any settings and data, you must create a config.xml file in the relevant directory. For example, if you are performing data migration from Magento 1 CE to Magento 2 CE, navigate to the <Magento 2 root dir>/vendor/magento/data-migration-tool/etc/ce-to-ce/<Magento 1.x version> directory and rename config.xml.dist to config.xml.

Next, open config.xml in your favorite code editor and specify the following:

In the above code, <source> has the database information of Magento 1 and <destination> has the relevant information of Magento 2. <crypt_key> is mandatory to fill in. It is the encryption key of Magento 1 which can be found in <Magento 1 root dir>/app/etc/local.xml file in <key> tag.

When finished, save the config.xml and you are done!

Migrate Settings

Data Migration Tool migrates settings from Magento 1 to Magento 2. These settings include stores, websites, system configurations such as shipping, payment, tax settings, etc. According to the Magento Data Migration Order, you should migrate settings first. To start migrating the settings, navigate to your Magento 2 root directory via SSH terminal and run the following command:

where <path to your config.xml> this would be vendor/magento/data-migration-tool/etc/ce-to-ce/<Magento 1.x version>/config.xml. I have used --reset argument in the above command which forces the Data Migration Tool to start from the beginning.

Once the settings migration is over, a successful message will be displayed.

Migrate Data

Data migration from Magento 1 to Magento 2 migrates products, categories, orders, customers, wish lists, ratings, etc. To migrate data, run the following CLI command:

As this command runs, the Data Migration Tool saves its current progress, and in the case of any errors, stops the process and resumes the progress from the last known good state. Also, the Data Migration Tool may report some errors during the migration. I advise you to refer the Troubleshooting page of the Data Migration Tool for further assistance.

Once the data migration is completed, you will receive a success message.

Final Thoughts

Once all migration processes are successfully over, do not forget to test the Magento 2 store completely to ensure that everything functions properly. Although I have outlined the entire migration process, it is not an easy task since it is not fully automated yet. You will have to do plenty of manual work to carry out migration from Magento 1 to Magento.

For smooth and trouble-free migration, I would recommend store owners hire a Magento professional for the job. In case, you face a difficulty in understanding the migration process, leave your questions in the comments section.

Start Creating Web Apps on Managed Cloud Servers Now!

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry

About Fayyaz Khattak

Fayyaz is a Magento Community Manager at Cloudways - A Managed Magento Hosting Platform. His objective is to learn & share about PHP & Magento Development in Community. Fayyaz is a food lover and enjoys driving. You can email him at m.fayyaz@cloudways.com

Stay Connected:

You Might Also Like...