Magento 2 Migration – Simple & Definitive Guide

Magento 2 Migration could easily be the top discussed topic at the moment. You guys all know Magento will only support Magento 1 until June of 2020. After that, you will be on your own with your website. There won’t be no more updates or security patches in the future (the last update was on Oct 8th, 2019).

However, this guide is not only for the business owner. Magestore is giving all developers the most simple and definitive guide to migrate from Magento 1 to Magento 2. If you have trouble following other guides, you will definitely complete the migration task using our step-by-step Magento 2 Migration guide.

In fact, the guide is so simple that even the newbies can do the Magento migration without doubt. It is an ultimate walkthrough for any Magento developers.

Before you start Magento 2 Migration

The Magento 2 Migration may be a simple process, but one mistake can cause severe damage to your whole process. If you want to make sure the process of Magento 2 Migration to go smoothly the first time, we highly recommend you to follow all recommendations below:

Make sure to back up your Magento 1 store, including all files, folders, and the database.

Make a clone for your Magento 1 store is recommended, so you can run the Magento migration process without affecting live site.

You should make a full analysis for your Magento 1 store. You can reduce time of the migration process by keeping only the necessary data.

Magento 2 Installation for Migration

Magento 2 installation is required (obviously) for any complete Magento 2 Migration. If you want to make a Magento 2 Migration test, you can first use the Magento 2 Installation on localhost. Or else, you can do a complete Magento 2 installation, but you need to check all the prerequisites to ensure Magento 2 work properly.

I recommend you to run Magento 2.3, which requires your server to have the following requirements in database:

For hardware recommendation, you need at least 2GB of RAM minimum, and 24GB+ SSD (Solid State Drive). If you are using a system with less than 2GB of RAM, we recommend you create a swap file; otherwise, your upgrade might fail.

This guide is used for Magento 2.3.3, but you can also do it for the later versions. I’ve used Nginx and PHP 7.1 to pair with Magento 2, since the latter comes with a premade configuration file, nginx.conf.sample.

Magento 2 Theme Migration

Magento 2 introduces new ways and technologies to show on front-end, and deliver enhanced shopping and store experience to the merchants and users. So to say, it is highly recommended to use the Magento 2 themes or modify the current theme to make them compatible with the Magento 2 standards.

In other words, it’s not easy to directly migrate your Magento 1 theme to Magento 2. If you need to save time, prepare to use Magento 2 themes instead.

But if you still want to migrate Magento 2 theme, you need to involve deeply into Magento 2 internals.

Here are a few things to keep it in mind:

The XML structure of Magento 2 is different than that of Magento 1, so you cannot simply copy and paste the layout files.

You should create Magento 2 theme based on the default Luma theme, which has great framework.

Utilizes all three modes of Magento 2. For example, use developer mode to develop, and then production mode once the site goes live.

Moreover, you must ensure your new Magento 2 theme to be responsive for best UX. So the best way to avoid all these hassles is just go and grab a proper Magento 2 theme from the Magento marketplace, or other reputed sources.

Magento 2 Extension Migration

If you want to know how to migrate extensions from Magento 1 to Magento 2, then the answer is: No, Magento 1 extensions won’t work with Magento 2. Extensions are essential components that provide new features and extend the functionalities of your Magento store. Any attempts to migrate Magento 1 extensions to Magento 2 will experience severe compatibility issues. Also, there is no reliable migration tool for Magento extensions.

If you really want an extension from Magento 1 to be migrated to Magento 2, you should look for the Magento 2 version on the developer’s website, like Magestore, Amasty, Aheadworks and so on. For any developers, it is difficult to migrate the extensions that you don’t make, so just avoid migrating them.

We will cover you on how to make Magento 2 extensions, in case you seriously want to migrate the function of Magento extension into Magento 2 store.

Migration Customizations

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 Magento migration may require additional work to make sure that the custom code successfully integrates with the Magento 2 store.

Magento 2 Data Migration

This is the final part of Magento 2 Migration, and this is also the most important part. You must migrate all data and settings from Magento 1, and move them to Magento 2. To simplify the Magento 2 Migration process, Magento has released an automatic Magento Data Migration Tool to help developer migrate their store data and settings using CLI commands. This is the most used method to migrate Magento 2, due to free of hassles and no loss of critical data like products, categories, orders, store configurations & settings, etc.

To perform Magento 2 Data Migration, you need SSH (Secure Shell) access to perform, so make sure to contact the system administrator or your hosting support team to grant the access.

Step 1Now, it’s time to install Magento 2 Data Migration Tool. You can install it from repo.magento.com using a PHP package manager software called composer. If you don’t have composer, let’s install it. Keep in mind that you must update the location of the Data Migration Tool package in the composer.json file to make it work.

Remember to double check the version of Magento 2 store and Data Migration Tool whether they match or not. For example, if you are using Magento version 2.3.2, you must install the Data Migration Tool version 2.3.2. In general, If you are using the latest version of Magento 2 platform, you have to use the most recent version of the Data Migration Tool as well. This is one of the most encountered errors when performing Magento 2 migration.

Take note of the end of the command, this is the version of your Magento 2 platform. Change it accordingly to your desire version of Magento 2.

Then, you will be asked for your developer authentication keys. It is easy to get it. Just go to the Magento Marketplace, sign in using your login credentials, head over to My profile, and click on Access Keys under My Products menu.

If you already have keys then, your public key will be your username and the private key will be your password. Otherwise, create a new key pair by clicking the Create a New Access Key button.

Hooray, you’ve finished the first step of Data Migration for Magento 2 Migration. You will see this if you’re successful.

Then copy
config.xml.dist file to
config.xml , or rename
config.xml.dist to
config.xml.

1.9.3.9 at the end of the previous code is your Magento 1 version, you should replace it with your actual Magento 1 version, and change
opensource-to-opensource to
opensource-to-commerce if you are migrating from the Community Edition to Enterprise (also known as Magento Commerce from now on). You can see the example below:

In the above code,
<source> has the database information of Magento 1 and
<destination> has the relevant database information of Magento 2. About the encrypted key, you can find it within
app/etc/local.xml in your Magento 1 root directory. The local.xml will look like this:

Step 3Now, you are on to the Magento 2 Setting Migration. These settings include stores, websites, system configurations such as shipping, payment, tax settings, etc. First, head to the Magento 2 root folder and run:

Make sure to specify the correct path to your
config.xml. More advanced, you can use
–reset argument in the above command which forces the Data Migration Tool to start from the beginning, so the command will be as following: