Bruce Lee

February 1, 2018

As Magento 2 is built on a completely different platform with Magento 1, it is important to notice that the code and database will not be able to kept but have to be rebuilt. Fortunately for all businesses, there are still transferable and also important parts which could help maintain the business continuity and save lots of time for the process. Those components include:

– Data
– Extension
– Themes and customization

Data Migration Tool

Among that, let’s talk a bit more about data migration. On an ecommerce website, while well-built extensions and rich features play the role of backbone, data feeds (product, customers info, past orders) are the crucial components that make the new site live and perform well in no time. A smooth transfer with no data loss will assure no bad experience happens to regular customers visit site and save unnecessary costs for store owners. Hereunder this topic, we show you some technical instruction of the Data Migration Tool to transfer and structure data safely when migrating your Magento ecommerce site.

1. Migration Tool

For data migration, Magento has direct support with the Migration Tool, that you can simply download on Github -  a web-based hosting service for version control using Git.

Data Migration Tool

– Open Magento 2 Data Migration Tool CE from Magento Team

Link: https://github.com/magento/data-migration-tool-ce

– Supported Version: Magento Community Edition (CE) version 1.6.x, 1.7.x, 1.8.x, 1.9.x

  • Three Modes of Data Migration

– Settings: Transfer all configuration and settings of the old website.

– Data: Transfer all data from Magento 1.x to Magento 2 ( order, category, product, cms, store, tax, rules,…).

– Delta: Transfer all other changes left to Magento 2 ( new customer, new order, review, …).

2. Steps to Migrate Data

Data Migration Tool

 3. Tool Settings

– Install from github:

+ composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool (run command)

+ composer require magento/data-migration-tool:<version> (run command)

+ where <version> is release version (e.g. 2.1.7)

Data Migration Tool

– Install from repo.magento.com: Create key access to account on magento.com.

+ composer config repositories.magento composer http://repo.magento.com

+ composer require magento/data-migration-tool:<version>

+ where <version> is release version (e.g. 2.1.7)

– Tool path: dir>/vendor/magento/data-migration-tool/

– Create file config.xml same as config.xml.dist in folder which version is the same with that of site magento 1.x.

– Edit file config.xml that corresponding to specific database:

Data Migration Tool

Data Migration Tool

 4. Functions of file mapping

Using file mapping to restructure responsive data from Magento 1 site on Magento 2:

Data Migration Tool

  • Options with file mapping

– Ignore the highlighted fields.

Data Migration Tool

– Rename: to map tables with different names together.

Data Migration Tool

– Move: to arrange fields with mapped data.

Data Migration Tool

– Transform: to create new fields that data has been mapped by behavior.

Data Migration Tool

 5. Migrate Setting

In this step, we will transfer the configuration and settings of the website.
– For the content, use:

file dir>/vendor/magento/data-migration-tool/etc/ce-to-ce/settings.xml.dist

<!> From Magento 2.2, use: file dir>/vendor/magento/data-migration-tool/etc/opensource-to-opensource/settings.xml.dist

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

E.g: php bin/magento migrate:settings -r vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.3/config.xml

Data Migration Tool

 6. Migrate Data

Data from website magento 1.x to magento 2 includes: order, category, product, cms, store, tax, rules ,…. To migrate data, use:

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

E.g: php bin/magento migrate:data -r vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.3/config.xml

Data Migration Tool

  • Errors encountered during Data Migration.

Data Migration Tool

– Error with Source Document: a table from Magento 1.x site does not exist on Magento 2 site.

– Error with Source Fields: a column in the table from Magento 1.x site does not exist in the responsive table of Magento 2 site.

  • Two ways to fix errors during data migration.

– Option 1: inform “ignore” the error table or column in file map.xml.

Data Migration Tool

– Option 2: create new responsive tables and columns for Magento 2 database.

 7. Migrate Delta (Migrate Changes)

Migrate Delta means transfer the changes from site Magento 1.x to Magento 2 at the last migration (new customer, new order, review, …). This procuess runs 5s once and you can stop the updates at any time by pressing CTRL+C.

To migrate delta, use:

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

E.g: php bin/magento migrate:delta -r vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.3.3/config.xml

Data Migration Tool

  • Errors encountered during Delta Migration.

Data Migration Tool

How to fix: Create new tables with responsive names in Magento 2 database with columns base on table ‘sequence_order_0’.

 8. Data should not migrate

– Indexed data

– Google shopping (which has been removed in Magento 2)

– Data that has not been supported by Magento 2: Poll, tag, staging module, and recurring profiles.

 9. Post-migration task

– Run the index : php bin/magento indexer:reindex

Data Migration Tool

– Flush cache: php bin/magento cache:flush

Data Migration Tool

– Copy image from <dir_m1>/media/catalog/ to <dir_m2>/pub/media/catalog/

– Copy image from <dir_m1>/media/downloadable/ to dir_m2>/pub/media/downloadable/

Source: MagentoDataMigrationWhitePaper

You can also view Magento 2 Backend Demo  to see how advanced that the new version of Magento would help us to manage online business. The decision to migrate can make right after that!

book a free demo

Hope that you find this information useful! If you need any help with Magento services or want to build a Magento e-store from scratch, feel free to contact us.

Leave a Reply