What is Magento Data Migration Tool?

Magento Data Migration Tool is a functionality provided by Magento which helps Magento 1.x merchants migrate their store to the new Magento 2.x version.

Since Magento announced Magento 1 end of life in June 2020, it’s urgent for you to upgrade from Magento 1 to Magento 2 to avoid negative impacts on your business performance.

In short, the migration process by Magento Data Migration Tool includes 4 steps:

  • Step 1 – Install Magento Data Migration Tool: install the tool on your server.
  • Step 2 – Configure migration: backup your database and make some changes to the code.
  • Step 3 – Migrate using Data Migration Tool: run commands to start the migration, fix errors if needed.
  • Step 4 – Post-migration checkup: double check your target store after the migration to make sure that there’s no missing data and errors.

This article will first discuss the pros and cons of Magento Data Migration Tool and then provide you detailed instructions of how to use it.

Let’s get started!

What are the pros and cons of Magento Data Migration Tool?

1. Pros

  • It is freely available for installation. You do not have to pay for anything no matter the amount of data that you have to migrate.
  • Magento provides very detailed documentation and instructions. You can follow Magento’s detailed step-to-step guideline along your migration process.
  • The tool allows you to migrate the newly added data in your source cart to the target cart after the first migration with Magento Delta Migration. However, it is important to note that in the Delta mode, the Data Migration Tool migrates data created only by Magento’s modules and is not responsible for the code or extensions made by third-party developers.

2. Cons

  • Downtime on your Source Store: After data update, you have to put your Magento 1 system in maintenance mode in order to cut over to the new site. Consequently, your store will go through a period of downtime.
  • No official support: Apart from the documentation, Magento does not provide any support personnel. Thus, users are fully responsible for the outcome of their migrations. Even though users can seek help on Magento community, most of the time, they just receive unofficial answers from other users.
  • Require highly technical knowledge from users. The process is extremely complicated which can lead to tons of errors which do not allow your migration to occur or result in missing data. Some of these errors are:
  • Exception printing
Exception Printing Error

It is a common error. You may face this error while installing a Magento 2 theme or module.

  • Data loss

After the migration is finished, products images don’t show up in the target store, which means they must be dropped off along the way.

Product Images Are Cut Off

Indeed, the two above are only a few in the numerous errors that you probably would have to deal with if you use Magento Data Migration Tool. Therefore, you have to backup your data beforehand, identify the errors and get them fixed. This process can be extremely resource and time consuming.

  • Another disadvantage is that with this tool, you have to manually migrate these 4 types of data: Media, Storefront design, Admin user accounts, Access Control Lists.
  • Last but not least, remember that this Magento Data Migration Tool does not support migration from other shopping carts to Magento. In this case, you can use an automated shopping cart migration tool like LitExtension.

Indeed, LitExtension’s automated shopping cart migration can easily surpass Magento Data Migration Tool in terms of simplicity, convenience, and superior features. Unlike Magento Data Migration Tool, LitExtension is capable of migrating media. Moreover, the team can even transfer data from extensions for you. 

In short, LitExtension ensures error-free migration with no programming or software skills required and 24/7 tech support and assistance. For more details, you can take a quick look at this comprehensive guide about Magento 1 to Magento 2 migration with LitExtension.

Now let’s move on to how to use Magento Data Migration Tool!

How to use Magento Data Migration Tool?

The tool runs in three modes:

  • Settings: migrates configuration settings
  • Data: bulk migrates main data in the database
  • Delta: transfers incremental data updates added to Magento 1 storefront and Admin Panel while running previous migration mode.

Step 1: Install Data Migration Tool

1.1. Install Data Migration Tool

Firstly, you must update composer.json in the Magento root installation directory to provide the location of the Data Migration Tool package. Let’s take the process of installation via Github as an example.

  1. Log in to your Magento server as, or switch to the Magento file system owner.
  2. Change to Magento 2 root directory.
  3. Enter the following commands:
composer config repositories.data-migration-tool git composer require magento/data-migration-tool:

1.2. Check the version of installed Data Migration Tool

Follow these steps:

  1. Change to your Data Migration Tool directory:
/magento/data-migration-tool.
  1. Open composer.json

The version entry in that file is the version of the Data Migration Tool.

Be noted that different Magento versions require different PHP versions. For example, to use Magento version 2.3.4, the PHP version 7.3 is required. This might be troublesome for merchants. You can look at one of the problems that may arise at Magento Community.

Step 2: Configure migration

2.1. Backup target store’s database

Follow the command:

mysqldump -uadmin -p databasename target> databasename target.sql

2.2. Configure migration

Before migrating any data, you must create a config.xml configuration file from the provided sample.

There are two possible ways to configure the Data Migration Tool for migration:

  • Configure migration in a separate module
  • Configure migration in the vendor folder

Here is how to configure migration in a vendor folder:

  1. Log in or switch to your Magento server as the Magento file system owner.
  2. Change to the following directory:
/vendor/magento/data-migration-tool/etc//
  1. Enter the following command to create a config.xml from the provided sample:
cp config.xml.dist config.xml
  1. Open config.xml in a text editor.
  2. The config.xml file must contain access details to M1 and M2 databases and encryption keys.
1    <source>
2    <database host=”127.0.0.1″ name=”magento1″ user=”root”/>
3    </source>
4    <destination>
5    <database host=”127.0.0.1″ name=”magento2″ user=”root”/>
6    </destination>
7    <options>
8    <crypt_key />
9    </options>

Optional parameters:

  • Database user password: password=<password>
  • Database custom port: port=<port>
  • Table prefix: <source_prefix>, <dest_prefix>

For example, if your database owner’s username is root with password pass and you use the prefix magento1 in your Magento 1 database, use the following in config.xml:

1    <source>
2    <database host=”127.0.0.1″ name=”magento1″ user=”root” password=”pass”/>
3    </source>
4    <destination>
5    <database host=”127.0.0.1″ name=”magento2″ user=”root” password=”pass”/>
6    </destination>
7    <options>
8    <source_prefix>magento1</source_prefix>
9    <crypt_key>f3e25abe619dae2387df9fs594f01985</crypt_key>
10   </options>

When finished, save your changes to config.xml and exit the text editor.

Step 3: Migrate using Data Migration Tool

3.1. Migrate settings

To start settings migration, run:

bin/magento migrate:settings [-r|--reset] {<path to config.xml>}

where:

  • [-r|–reset] is an optional argument that starts migration from the beginning. You can use this argument for testing migration.
  • {<path to config.xml>} is the absolute file system path to the migration tool’s xml file; this argument is required.

The migration completed message is displayed after the settings are transferred successfully.

3.2. Migrate data

To star data migration, run this command:

bin/magento migrate:data [-r|--reset] [-a|--auto] {<path to config.xml>}

where:

  • [-a|–auto] is an optional argument that prevents migration from stopping when it encounters integrity check errors.
  • [-r|–reset] is an optional argument that starts migration from the beginning. You can use this argument for testing migration.
  • {<path to config.xml>} is the absolute file system path to config.xml; this argument is required

3.3. Migrate changes

Delta functionality is responsible for delivering the rest of the data that was added after the main migration. After main migration, additional data could have been added to the Magento 1 database (for example, by customers on the storefront). To track this data, the tool sets up the database triggers for tables at the beginning of the migration process. 

To run recent data, run the command line:

bin/magento migrate:delta [-r|--reset] {<path to config.xml>}

However, be careful with an unstoppable circle of data processing over and over. We have encountered this issue after running the command line and have not found a solution yet.

An Unstoppable Circle Of Data Processing

Step 4: Post-migration checkup

There are several errors that you are likely to encounter when migrating data with this tool. To avoid your data being missed out along the way, it is necessary to check all of the entities of your store from both backend and frontend to identify any errors and get them fixed. 

Conclusion

As the support of Magento 1 has come to an end, the demand for migration from Magento 1 to Magento 2 is booming. We have gone through the step-by-step instruction of how to migrate with Magento Data Migration Tool and its advantages and disadvantages. Hopefully, this article has provided you with the information that you are seeking.

Author

Vinnie has worked as a business analyst and marketing specialist for 4 years. She is always fascinated by how merchants run their businesses and enjoy contributing valuable contents to help her clients.

Write A Comment