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

migrate magento website

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 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.

migrate magento website 1

– 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

migrate magento website 2

 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)

migrate magento website 3

– 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:

migrate magento website 4

migrate magento website 5

 4. Functions of file mapping

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

migrate magento website 6

  • Options with file mapping

– Ignore the highlighted fields.

migrate magento website 7

– Rename: to map tables with different names together.

migrate magento website 8

– Move: to arrange fields with mapped data.

migrate magento website from 1.x to 2.x

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

migrate magento website from 1.x to 2.x 2

 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

migrate magento website from 1.x to 2.x 3

 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

how to migrate magento website from 1.x to 2.x

  • Errors encountered during Data Migration.

how to migrate magento website from 1.x to 2.x 2

– 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.

how to migrate magento website from 1.x to 2.x 3

– 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

how to migrate magento website from 1.x to 2.x 4

  • Errors encountered during Delta Migration.

how to migrate magento website from 1.x to 2.x 5

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

how to migrate magento website from 1.x to 2.x easily

– Flush cache: php bin/magento cache:flush

how to migrate magento website from 1.x to 2.x easily 2

– 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

Leave a Reply