Magento 2 was finally launched in November last year, after a very long wait. Apparently the wait was worth it, because the new version of Magento seems to be built on an altogether different architecture and is much more optimized, fast and user-friendly. If you are planning to build a new Magento store, it is almost a no-brainer that you should be using Magento 2 for your new Magento project.
However, if you already have a Magento 1 store, the release of Magento 2 will put you in a bit of quandary on whether you should stick to Magento 1 or switch to Magento 2. In this article, and an upcoming article on the same topic, I’ll briefly discuss the migration process to Magento 2, and all the important aspects you need to consider for this migration.
The first decision you need to make here is: should you stick with Magento 1 for a while, or start the migration to Magento 2 right away? Here are a few things to consider while making this decision:
If you have considered all the pros and cons of
transferring to Magento 2 and have taken the decision to migrate, here is a brief
overview of the steps required to transfer your site to Magento 2.
As discussed above, have a good look at the availability of your required extensions and themes—you should be sure they are available in Magento 2. Also, look for any unnecessary extensions you can drop, as well as any database assets you have to migrate and any assets you can drop.
Check with your hosting company if it has all the required capacity to host Magento 2 without a problem, and if it can also sustain and support your website when traffic scales in future.
Create a fresh installation of Magento 2, and after installation back up or dump your Magento 2 database as soon as possible
Next, start installing your required extensions on this fresh Magento 2 store.
Install the Magento migration tool (steps given below) and make sure it has access to both the Magento 1 and Magento 2 databases to start the migration process.
Stop Magento 1 cron jobs and also all the activity in the Magento 1 admin panel other than necessary order management issues, and do not resume the activity until the migration process is completed and the Magento 2 site goes live.
Manually transfer all the media files from your Magento 1 site to Magento 2, and use the Magento migration tool to migrate the settings to the Magento 2 site.
Now use the migration tool to completely transfer the Magento 1 database to the Magento 2 database. Both databases have different structures, but the migration tool knows what to transfer where, so that the data remains accessible in your Magento 2 installation. However, if you are using an extension which uses its own data, and when you transfer it to Magento 2 it has a different database structure for Magento 2, use the mapping files that come with the data migration tool.
Once you have completed the database transfer, reindex your Magento 2 site.
And, as always, the last step is to conduct thorough testing of your new Magento 2 site.
Although you stopped most activity in the Magento 1 admin panel before the start of the migration process, perhaps there were some order processing issues going on. Also, maybe new user reviews or changes in customer profiles occurred during this time. Now you need to migrate that data using incremental updates.
Once you've ensured that you have completely transferred all the data to your Magento 2 site, and everything is working absolutely fine, it’s time to go live. For that, put your Magento 1 site into maintenance mode, stop the migration tool, start Magento 2 cron jobs, and point your DNS load balancers to the new production hardware. And you are done!
This flowchart diagram explains all the steps for migration:
Note this was just an overview of the migration process so that you can properly plan for it. A more
detailed explanation of all these steps will be given in an upcoming article
on the same topic.
Though I’ll explain all the migration step details in the next article, here are some best practices to keep in mind:
<direct_document_copy>1</direct_document_copy>option in your config.xml. To do that, the Magento 1 and Magento 2 databases should be located in one MySQL instance, and the database account must access each database.
Now I'll give you an estimate of a professional migration process time, as given in the Magento devdocs. A Magento store hosted on VirtualBox VM, CentOS 6, 2.5Gb RAM, CPU 1 core 2.6GHz environment, with database of around 177k products, 355k orders, 214k customers took approximately 10 minutes to migrate settings and 9 minutes to migrate data, and the site had to remain in maintenance mode for a couple of minutes to reindex the Magento 2 site and to change the DNS settings.
Though the migration tool is of great help for migrating your data and settings to Magento 2, not all the data can be transferred via this migration tool. These are the three types of data that you need to transfer manually (instructions on how to do that in next article):
Before you install the Migration tool, make sure you have completed all the steps in the ‘Review your website’, ‘Planning for infrastructure’ and ‘Creating Magento 2 store’ phases, as explained above. Once you have done all that, use the instructions below to install:
Log in to your Magento site server as the user with privileges to edit and create files.
Go to the Magento 2 root directory, and enter the following command to update the composer.json file first:
composer config repositories.magento composer https://repo.magento.com
Next, enter the following command to require the current version of the package:
composer require magento/data-migration-tool:2.0.0
This will install version 2.0.0 of the package. If you intend to use a different package version, set the version in the command accordingly.
Wait while dependencies are installed. Once done, enter these two commands to install the migration tool:
composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool-ce composer require magento/data-migration-tool:dev-master
When you run these
commands, it’ll prompt you for authentication keys. For the public key, enter
your username, and for the private key, enter your password. More information on
authentication keys can be found in the Magento devdocs.
This should install the Magento migration tool on your Magento 2 store. We’ll use it to initiate and complete the transfer following the procedures explained in the next article.
In this article, my intention was to point out some key things to consider to help you decide if it's a good decision to migrate to Magento 2 for your store. I also gave an overview of the migration process for your planning purposes, and gave you some tips for best practices in the migration process. As a first step, we have also installed the Magento data migration tool.
We’ll proceed from where we have left today in the next article!