Understand the Magento 2 data migration tool!

Magenest JSC
5 min readMar 4, 2020
Magento 2 migration

If you’re looking to move all your data and content from Magento 1 to Magento 2, then that’s a very good thing to consider.

However, the challenge is that you need to figure out how you can do without dealing with data loss, website problems and so on.

Using a reliable Magento 2 data migration tool can help you here and the results will be quite great.

Why should you move to Magento 2?

Magento 1 is not receiving any updates now since version 2 is in the forefront. That means you will have less security and your website can be prone to hacking.

Not only that, but any of the new features for Magento 2 will not be added to the previous version.

Plus, Magento 2 is offering faster website speed, better performance and it also manages to bring in a much better feel for the customer. For that reason alone, it really stands out and it conveys a sense of value and professionalism.

Things to keep in mind before you migrate to Magento 2

It’s a very good idea to assess what you want to be removed from your site before upgrading. Needless to say, you must perform a complete backup for your previous Magento installation, its folders and database as well.

Ideally, you want to avoid using the live store for migrating. Instead, you want to transfer the data with the Magento 2 data migration tool from the cloned database. Of course, if you still want to use custom code, extensions or themes, check compatibility first to see if that can work for you or not.

Normally when you want to migrate data you just need 4 steps. There’s the theme migration, extension migration, customization migration and lastly the full data migration. Yes, migrating the extensions, themes and customizations are just as important as the data itself, and that’s why we will be covering this as well as the other factors.

Customization migration

You can do that with help from the Code Migration tool. Run the toolkit they provide and then generate some of the files manually.

Extension migration

Normally you can integrate the same extensions if they are compatible with the new version. In case they are not compatible, which might happen, it can be a very good idea to add new extensions. There might be some new ones that offer the same functionality, yet they work very well for the new version.

Theme migration

Here you want to do pretty much the same thing, you want to check if the current Magento 1 theme works with the new version. You will reinstall the same one, or you can create a custom theme, maybe you can purchase a new one if needed. The choice is up to you here and it will be a good idea to see what you can do, then go from there.

How can you use the Magento 2 data migration tool?

The first thing you want to do is to install the Magento 2 data migration tool via Composer. Make sure that the migration tool and the Magento 2 version are the same, just tom be safe. If you don’t know that, you can easily go to the SSH terminal, type

“ PHP bin/magento –version”

and that will give you the version.

You want to update the migration tool located within the composer.json file that’s in the root directory. You can follow this command:

“composer config repositories. magento composer https://repo.magento.com

and then use

“Composer require Magento/data-migration-tool:<version>”

Obviously you need to add the current version in there if needed.

At this point, you need to add the authentication key. In order to do that you just have to go the Magento Marketplace, sign in and then you can find the access keys there. The public key will be your username, the private one is seen as your password. Or you can create a new pair if you want.

Configuring the Magento 2 Data Migration Tool

Now that the migration tool is installed, you will go to

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

and here you can find configuration and mapping files.

If you migrate from the enterprise edition to the same edition, use

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

We recommend you to create a config.xml file in the directory where you add:

“ <source>

<database host=“localhost” name=“Magento1-DB-name” user=“DB-username” password=“DB-password” />

</source>

<destination>

<database host=“localhost” name=”Magento2-DB-name” user=“DB-username” password=“DB-password” />

</destination>

</options>”

Once you do that you will be able to save the config.xml file and then you can use it.

Migrating settings

The Magento 2 data migration tool can help you migrate settings like shipping, tax, payments and stores or system configuration.

Go to the root directory via the SSH terminal and then you can add the following command:

“php bin/magento migrate:settings — reset <path to your config.xml>”

Once the migration is complete, you will receive a message letting you know that everything was done correctly and without any issues.

Data migration

Now that you migrated pretty much everything aside from data, you can finally migrate ratings, categories, customers, products, orders, wishlists and many others. You just need to follow the

“ php bin/magento migration:data — reset <path to your config.xml>” command.

Should you use the Magento 2 data migration tool?

Yes, if you want to migrate all the previous Magento data to Magento 2, the data migration tool can do wonders for you. While it might seem a bit overwhelming to adapt and use based on your needs, this is certainly worth a shot, and you will be heavily impressed with its feature set. Just check it out, it can be well worth your time.

Final Words

Magento 2 is the best open-source eCommerce platform at the moment, so why not get a hand into the advanced technology right today?

As one of the most trustworthy Magento Solution Partners, Magenest is the perfect providers for your Magento migration process. With more than 7 years in the business, they guarantee a secured and comprehensive transformation from Magento 1 to Magento 2, or from any platforms to Magento 2! Magenest also provide a huge source of helpful Magento 2 extensions to support your online growth!

--

--

Magenest JSC

Magenest JSC is a full-scale digital solution provider with a special focus on eCommerce, ERP, CRM, Cloud Infrastructure… Website: https://magenest.com/