Data Migrate From Magento 1 to Magento 2

Posted on 9 June, 2017

If you think about Magento Migration then you are certainly at the right place. In Magento Migration process there is a main four type of migration process Data Migration, Extension Migration, Customizations Migration and Theme Migration. In this technical note, we'll let you know the process of Data Migration. Before starting this process you must know which type of data migrate while doing data migration process.

Data Migrate will include all the information stored in your site, covering your database belonging to that Magento instance. All the important stuff like orders, customers, products, configuration settings will be beautifully transferred to your new site. This is the base stage where all the default data of Magento will be operated.

Below are the list of data which migrate on data migration

- Websites, stores, store views
- Product categories and their settings
- Products that covers content, core attributes and such other settings.
- Product Reviews
- Catalog URL Rewrites
- Customers and their orders, invoices, shipments, credit memos.
- Transactions
- Attributes and values
- Attribute sets
- Taxes
- Catalog and shopping cart price rules
- All the important Newsletter & CMS data
- Currencies, user accounts and roles

Before you start Migration process make sure Magento 1 (Your current site) and Magento 2 (Fresh installation) both are on the same server.

Note: For data security purpose we’ll suggest you take your database and source backup before you perform following steps. You can perform all of these steps with your own risk this site is not responsible for any loss or damage.

Let’s Start

First, you need to open Command line in folder root of Magento and run below commands one by one.

composer update

After complete composer update process run below command

composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool

After complete above command process run the below command but before run that command you just need to changes data-migration-tool:2.1.5 latest version.

composer require magento/data-migration-tool:2.1.5

After run above command it was copy migration tool at Magento Root/vendor/magento/data-migration-tool. Before run next command you need to change in config.xml file. For Change in config file first you need to know about you Magento 1 version and navigate to the folder same as Magento 1 current version. For Ex : Your current Magento 1 version 1.9.2.4 and its Community Edition then you need to go to the Magento 2 Root/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.4/config.xml.dist file and rename to config.xml and open and edit config.xml file.

Find following code on config file and change Magento 1 and Magento 2 host, database name, user and password.

1
2
3
4
5
6
<source>
    <database host="127.0.0.1" name="magento1" user="root" password="pass"/>
</source>
<destination>
    <database host="127.0.0.1" name="magento2" user="root" password="pass"/>
</destination>               

Also, find another code on same file if you use prefix on your Magento 1 database.

1
2
3
4
// Find
<source_prefix />
// Change to
<source_prefix>magento1</source_prefix>

Also, find another code on same file and add crypt_key of your Magento 1. You’ll get this key from your Magento 1 Root/app/code/etc/local.xml and find and copy that key from that file and paste it between crypt_key as per following example.

1
2
3
4
// Find
<crypt_key />
// Change to
<crypt_key>f3e25abe619dae2387df9fs594f01985</crypt_key>

After Made all the changes on config.xml file run following both commands one by one.

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

php bin/magento migrate:data --reset vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.4/config.xml

You can use -r or --reset. -r or –reset is an optional argument that starts migration from the beginning. You can use this argument for testing migration.

If completed all this steps successfully then congratulation you are successfully Migrate data from Magento 1 to Magento 2.

After you have completed your migration and thoroughly tested your new Magento 2 site, perform the following tasks:

- Flush all Magento 2 cache types
- Reindex all Magento 2 indexers

After completed data migration incase if you want to do Delta migration then run following command on command line.

Delta is used for incremental migration. Incremental migration enables you to migrate only the changes made in Magento 1 since the last time you migrated data. These changes are:

– Data that customers added via storefront (created orders, reviews, changes in customer profiles, etc.)
– All operations with orders in the Magento Admin panel

php bin/magento migrate:delta vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.4/config.xml

Site migration from Magento 1 to Magento 2 requires accuracy if you are not comfortable with the migration process. We can help you convert your site to Magento 2 so that you can be benefited from Magento 2 features. Contact us Now!

We hope you easy to understand this Magento technical note with above steps and you are successfully Migrate data from Magento 1 to Magento 2. See you again in our next note. Bookmark it for your future reference. Do comment below if you have any other questions or doubts on Migrate Data from Magento 1 to Magento 2.

P.S. Do share this Post with your team.


Mayank Zalavadia , eCommerce Project Manager
Magento Technical Notes

Post Your Review

X

Your Review has been posted

0 Comment(s)