Magento 2 Migration Foolproof Complete Guide

The team of Magento has finally announced officially, that is regarding support for version 1 will end in JUNE 2020.All user looking for Magento 2 migration.

If you still not migrated data from Magento 1 to 2, then this tutorial will help you step by step to migrate your data.

Step 1: Download and installation of Magento 2

In this we going to install the magento 2 via composer.

So please check on your system whether the composer is installed on your system or not.if it is not installed on your system then you can download and install from here by clicking the link: COMPOSER.

So Let’s start with the installation of magento 2 via composer.

To install Magento 2, run the below command in cmd or git bash.

$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition install-directory-name

Example :

$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:2.3.0 magento230/

Step 2: Install Magento 2

To install magento 2 run the below command :

$ bin/magento setup:install \
--base-url=http://localhost/magento230\
--db-host=localhost \
--db-name=magento \
--db-user=magento \
--db-password=magento \
--admin-firstname=admin \
--admin-lastname=admin \
[email protected] \
--admin-user=admin \
--admin-password=admin123 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1

In this installation process you might get blank page issue to fix this check this link Magento 2.3 admin blank page occur.

Step 3: Installed Magento 1

Now after a installation, we have a fresh Magento 2 store, it is time to migrate the data from the old Magento 1 site.

In below as you are seeing old Magento 1 store with data,It is nothing but just a fresh Magento 1.9.3.9 install loaded with sample data.

Magento 1 with sample data
Magento 1 with sample data

Download this from official Magento site.

Step 4 : Migrate Magento 2 Data from Magento 1:Magento 2 Migration

Team of Magento has a very unique and simplified, Magento 2 migration process with an automatic tool called Magento Migration Tool (MMT).

This program will help in transferring the data from old Magento 1 installation to new Magento 2 store.

Install the MMT from repo.magento.com using composer.

A very important point before installing the migration tool in Magento 2 is that Versions of Migration Tool and Magento which is used to transfer data must match.

That is Magento version 2.2.0, you must also use the same Date Migration Tool version 2.2.0, so please be confirm about this before installation process.

So to install migration tool in magento 2 on your system , run the below command in cmd or git bash.

$ composer require magento/data-migration-tool:2.3.0

Please Take note of the 2.3.0 which at the end of command. That is our Magento 2 platform version

Use command accordingly if your migrating to different version.

After runing command in cmd you will see screen like this :

$ composer require magento/data-migration-tool:2.3.0
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing magento/data-migration-tool (2.3.0): Downloading (100%)        
Writing lock file
Generating autoload files

Now we will going to configure MMT tool.

For that Lets Go to the Magento 2 root folder and find the following directory:

vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.9

After which then Copy config.xml.dist file to config.xml

Now important work in migration is to substitute 1.9.3.9 with your site’s Magento 1 version and change opensource-to-opensource to opensource-to-commerce if you are migrating from the Community Edition to Enterprise (now known as Commerce).

Now next important point is to open config.xml and find the code below:

<source>
  <database host="localhost" name="magento1" user="root" />
</source>
<destination>
  <database host="localhost" name="magento2" user="root" />
</destination>

Now next important thing is to enter Magento 1 and Magento 2 database credentials.

Then, include password attribute like this:

<source>
  <database host="localhost" name="magento1" user="magento1" password="magento1"/>
</source>
<destination>
  <database host="localhost" name="magento2" user="magento2" password="magento2"/>
</destination>
Now very important point is that inside the <options> tag is another mandatory field is to specify - <crypt_key>:
<options>
……
<crypt_key>c6f507df8208b51e8583686dbb676dea</crypt_key>
…
</options>
M1 crypt_key within the app/etc/local.xml file inside your old site’s root folder.
<config>
    <global>
        <install>
            <date><![CDATA[Thu, 04 Jun 2020 11:39:49 +0000]]></date>
        </install>
        <crypt>
            <key><![CDATA[c6f507df8208b51e8583686dbb676dea]]></key>
        </crypt>

Step 5 : Migration Settings

Now it is important step is to start with actual process of data migration.

So first we do migrations setting to do that head over to magento 2 root folder and run the below command.

php bin/magento migrate:settings vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.9/config.xml

Before doing this make sure that specify the correct path of config.xml , After executing the above command you will get the following result.

php bin/magento migrate:settings vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.9/config.xml
 
[2018-09-14 18:22:22][INFO][mode: settings][stage: integrity check][step: Settings Step]: started
100% [============================] Remaining Time: < 1 sec
[2018-09-14 18:22:22][INFO][mode: settings][stage: integrity check][step: Stores Step]: started
100% [============================] Remaining Time: < 1 sec
[2018-09-14 18:22:22][INFO][mode: settings][stage: data migration][step: Settings Step]: started
100% [============================] Remaining Time: < 1 sec
[2018-09-14 18:22:24][INFO][mode: settings][stage: data migration][step: Stores Step]: started
100% [============================] Remaining Time: < 1 sec
[2018-09-14 18:22:24][INFO][mode: settings][stage: volume check][step: Stores Step]: started
100% [============================] Remaining Time: < 1 sec
[2018-09-14 18:22:24][INFO][mode: settings][stage: volume check][step: Stores Step]: Migration completed

Step 6 : Initial Migration of Data

Now our important point is to migrate data or we can say that ready to transfer orders, customers and the actual store data. So we can do this by executing the below command :

$ php bin/magento migrate:data vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.9/config.xml

There is two way to achieve migration of data: Manual way and Automated way. We go in the automated way because it save more time. So let’s start with this.

Notice: In an automated way you can use --auto or -a option to ignore not to mapped differences between source and destination to migration continue. Finally, i am successfully migrating data by using an automated way method command.

$ php bin/magento migrate:data  -r -a  vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.9/config.xml
[2018-09-19 17:48:50][INFO][mode: data][stage: integrity check][step: Data Integrity Step]: started
…..
…..
…..
[2018-09-19 17:49:11][INFO][mode: data][stage: volume check][step: Tier Price Step]: started
100% [============================] Remaining Time: &lt; 1 sec
[2018-09-19 17:49:11][INFO][mode: data][stage: data migration][step: SalesIncrement Step]: started
100% [============================] Remaining Time: &lt; 1 sec
[2018-09-19 17:49:11][INFO][mode: data][stage: volume check][step: SalesIncrement Step]: started
100% [============================] Remaining Time: &lt; 1 sec
[2018-09-19 17:49:11][INFO][mode: data][stage: data migration][step: PostProcessing Step]: started
100% [============================] Remaining Time: &lt; 1 sec
[2018-09-19 17:49:11][INFO][mode: data][stage: data migration][step: PostProcessing Step]:
<strong>Migration completed</strong>

Now if you open the browser you will get data is migrated to magento 2 site.

Magento 2 site with migrated data
Magento 2 site with migrated data

Step 6: Migration Media Files

Notice : For Media files, If you store your all media in a database (as Magento 1 can do), it will automatically get transferred to Magento 2.You have to do just Sync it before migration data :

Magento 1 backend menu > System > Configuration > Advanced > System
Click on a Synchronize button
Synchronize Media
Synchronize Media
In this, I have stored media in a file.Final step is to copy the data over to M2, we have to simply copy the M1:media folder over to M2:pub/media:
cp -r /path/to/magento1/media /path/to/magento2/pub

After which execute below command , then you will see all image are display on site.

php bin/magento indexer:reindex
php bin/magento deploy:mode:set production
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f

Now, you will that our website should have all our Magento 1 products, along with images.

Migrated Data
Migrated Data

Leave a Comment