4.4 (88.57%) 7 votes

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.

Now, let’s begin our comprehensive Magento 2 Migration.

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:

  1. Make sure to back up your Magento 1 store, including all files, folders, and the database.
  2. Make a clone for your Magento 1 store is recommended, so you can run the Magento migration process without affecting live site.
  3. 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.
  4. The whole Magento 2 Migration process needs theme, extension and custom code migration. You should check whether the data migration is compatible with Magento 2 or not.
  5. Any unnecessary data from the database should be removed. This includes logs, recently viewed products, compared products, etc.

These above recommendations are optional, but if you can follow them all, you can ensure a complete and successful Magento 2 Migration.

A full Magento 2 Migration consists of 5 steps:

  1. Magento 2 Installation
  2. Theme Migration
  3. Extension Migration
  4. Customizations
  5. Data Migration

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:

  • PHP: 7.1.3, 7.2.0 or 7.3.0.
  • MySQL: 5.6, 5.7 or MariaDB 10.0, 10.1, 10.2, Percona 5.7, and other binary-compatible MySQL technologies.
  • Required PHP extensions: all ext bc-math, ctype, curl, dom, gd, intl, mbstring, mcrypt, hash, openssl, iconv, pdo_mysql (PDO/MySQL), simplexml, soap, spl, xsl, zip, libxml. Refer to official PHP documentation for installation details.

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.

  • Magento 2 replaces the prototype JS framework of Magento 1 with jQuery.

  • Creating CMS pages is similar.

  • 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.

That’s why developers are selling both Magento 1 extensions and Magento 2 extensions separately.

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.

Here is the command to place the files into a Magento 2 folder:

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.

Step 2It’s time to configure Magento Data Migration Tool.

First, go to this directory in the Magento 2 root folder

Then copy  config.xml.dist file to  config.xml , or rename  config.xml.dist to  config.xml. 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:

Next, open  config.xml and specify the following:

The  Magento1-Encrypted-Key is somehow like this:

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:

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

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:

If there are no errors, you will get a successful message like this:

In case you can’t successfully migrate settings to Magento 2, consider changing the following default setting in the XML configuration file –  config.xml.

You need to copy this line of code:

into  settings.xml before editing. If you need to ignore a setting, you should add this:

Also, you need to rename:

Once done, you can set up settings.xml any way you need.

Step 4Finally, you’re ready to migrate data from Magento 1 to Magento 2, which includes products, categories, orders, customers, wish lists, ratings, etc. Simply inputting the CLI command:

Again, you can use  reset argument to force the Data Migration Tool to start from the beginning, and the above command will be replaced to this:

If you don’t encounter any errors, there is a successful display like this:

Step 5But life isn’t always as simple as you think, you can get the Integrity Check failed message:

Now, we will fix them all.

1, First error: Foreign key constraint fails on source database

We need to delete any orphan records from the specified tables, with this command:

2, Second error: Field is not mapped

You can also encounter this error, which can also be fixed like the first error. Here is the error log:

Just rename the  map-eav.xml.dist to  map-eav.xml and change the  config.xml file as well. Then open the XML file of map-eav and add these following lines:

The Data Migration Tool will ignore the unmapped field, therefore solve the issues. Don’t forget to add –reset or -r switch to the migrate:data command so the changes are picked up.

3, Third error: Documents are not mapped

The error is shown as below:

So go to XML map file:

And ignore the statements, just like the second error.

Do you get it? If field isn’t mapped, we ignore the table field, and if the documents aren’t mapped, we will ignore the documents. It takes you only half an hour to pass the integrity check.

*** UPDATED: Thanks to goivvy, we have another way to fix any mapped errors. Just add –auto or -a option like this.

Step 6Last step involves in migration of media files to your new Magento 2 store.

It will be easier if you stored your media in a database. Just simply sync it before data migration. Go to the back-end menu and System > Configuration > Advanced > System. Then click Synchronize.

Now, we have a media folder of Magento 1, let’s copy it to Magento 2:

Then, we need to reindex Magento 2 store with this command:

Finally, recompile it with the following command:

You have finished the step-by-step guide for Magento 2 Migration. Congratulations. If you find any errors after migration, be sure to check Magento 2 Migration Most Common Errors.

Thank you for reading! Happy Migrating!

Custom Your Own Magento 2 One Step Checkout
Magento Data Migration Tool - Simple Manual

Leave a Reply

Your email address will not be published. Required fields are marked *