Install The Data Migration Tool For Magento 2: Modes & Stages

Install The Data Migration Tool For Magento 2: Modes & Stages

Are you considering moving your store to Magento 2? The data migration tool for Magento 2 helps you transfer data from Magento 1 to Magento 2, ensuring your store's integrity and performance.

This tutorial covers the installation steps, uses, and package components of the data migration tool.

Best Magento Hosting now

Key Takeaways

  • Learn how to install the Magento Migration through the Magento root installation directory.

  • Understand how to use the data migration tool to use your Magento 1 extensions.

  • Get an overview of the ecommerce platform to move all of your products to Adobe Commerce.

  • Get insights into the config process of your username with other details.

  • Discover the 3 steps to integrate the commerce platform by logging in to your Magento panel.

What Is Magento Data Migration Tool Used For?

Functionalities of data migration tool in Magento 2

The Magento Data Migration Tool is a command-line interface. It helps merchants efficiently transfer data from a Magento 1 store to a Magento 2 store. This tool verifies consistency between Magento 1 and Magento 2 database structures. Also, it migrates the progress of the data transfer process. Maintaining database structure consistency ensures data integrity during migration. It prevents data loss and identifies potential compatibility issues before they become problematic.

For example, you can log the migration process for troubleshooting. Also, you can run verification tests to confirm successful data migration.

How To Find The Latest Version Of The Data Migration?

1. Software Version

i. To determine your Magento 2 version, execute the following command in the terminal:

php <your Magento 2 install dir>/bin/magento --version

ii. If you have obtained the Magento 2 software via Composer, run these commands:

cd <your Magento 2 clone directory> git branch

Note: If you are on the default develop branch, switch to the released branch first.

2. Data Migration Tool Version

i. Navigate to your Data Migration Tool directory. Run the following command: vendor/Magento/data-migration-tool

ii. Open the composer.json file in a text editor.

iii. Locate the "version" value to see the current version of your tool.

What Data Can Be Migrated To Magento 2?

Data Type Attributes
Products - Name, SKU, Short Description, Full Description, Status
- Manufacturer, Country of Manufacturer, Tax Class, Sort Order in Category
- Price, Special Price, Special Price From-To Date, Group Price
- URL Key, Meta Title, Meta Keywords, Meta Description
- Weight
- Related Products, Up-sells and Cross-sells
- Attributes (Name, Values)
- Drop-down, Radio Buttons, CheckBox, Multiple Select, Date, Text Field, Text Area, Time, Date & Time, File
- Downloadable Products (Price, Files, Max Downloads), Grouped Products (Associated Products), Bundle Products
- SKU, Weight, Attributes, Quantity, Images, Price, Special Price, Special Price From-To Date, Name, Group Price
- Thumbnail Image, Additional Images
- Quantity, Manage Stock, Availability
Product Categories - Name, Description
- Status, Is Anchor, Sort Order
- Thumbnail Image
- URL Key, Meta Title, Meta Description, Meta Keywords
Customers - ID, First Name, Last Name, Date of Birth, Email, Created Date
- Customer Group
- Newsletter
- Company, Address 1, Address 2, Country, State, City, Zip Code, Telephone
- Company, Address 1, Address 2, Country, State, City, Zip Code, Telephone
Orders - ID, Order Date, Order Status
- Name, SKU, Option, Product Price, Quantity
- Sub Price, Discount Price, Tax Price, Shipping Price, Total Price
- Order Comments
- Customer Name, Email
- Company, Address 1, Address 2, Country, State, City, Zip Code, Telephone
- Company, Address 1, Address 2, Country, State, City, Zip Code, Telephone
- Transactions, Invoice, Credit Memo, Shipment
Manufacturers - Name
Taxes - Tax Class (Name)
- Tax Rate (Country, Rate)
- Tax Rules
Coupons - Name
- Description
- Status, Coupon Code, Coupon Date
- Customer Groups
- Uses Per Coupon, Uses Per Customer
- Type Discount, Discount Amount/Percent
Reviews - Created Date
- Status
- Rate
- Product
- User Name, Email
- Summary
CMS Pages - Created Date
- Status
- Title, Description
- Meta Title, Meta Description, Meta Keywords
Multiple Languages - Products (Name, Description, Attribute)
- Categories (Name, Description)
- CMS Page (Name, Description)
- Blogs (Name, Description)

How To Transfer Data Using The Magento Data Migration Tool?

  1. Log into your Magento server as a user with write permissions to the Magento file system.

  2. Add <magento_root>/bin to your system PATH to run commands from any directory. For example, in a bash shell for CentOS:

$ export PATH=$PATH:/var/www/html/magento2/bin

  1. Consider a typical migration command:

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

In this command:

  • can be settings, data, or delta.
  • [-r|--reset] is an argument that initiates the migration.
  • {} is the absolute file system path to config.xml.

Required Steps For Migration Magento 2 Installation

1. Check the Magento 2 version

  • Verify the version of your Magento 2 installation.

  • Ensure that the Data Migration Tool version matches the 2.4.x version.

2. Update composer.json

3. Obtain authentication keys

  • Log into your Magento Marketplace account and go to the Access Keys section.

  • Retrieve your public and private keys for authentication.

4. Install via Composer

  • Run composer config and composer require commands to configure the GitHub repository.

  • Install the Data Migration Tool, specifying the version to match Magento 2.

  • Provide authentication public keys when prompted.

5. Verify installation

  • Navigate to vendor/magento/data-migration-tool.

  • Check for config.xml.dist and the bin directory to confirm successful installation.

6. Configure config.xml

  • Copy config.xml.dist to config.xml.

  • Update it to specify database credentials, source/destination database names, and table prefixes.

7. Configure migration mode

  • Decide which mode to run the tool in - settings, data, or delta.

  • Each mode migrates different data.

8. Run integrity check

  • Execute the migration tool with the --integrity-check flag first to compare table structures between M1 and M2.

  • Check for compatibility issues before proceeding.

9. Backup data

10. Run data migration

  • Execute the Data Migration Tool in the configured mode to transfer settings.

  • Configure bulk data, incremental changes, or any errors.

11. Verify migration

  • Check that all expected data has been migrated to Magento 2.

  • Manually inspect the migrated data in the Magento Admin and database.

  • Verify accuracy and completeness.

Data Migration Tool Package

1. Modes

Mode is a sequence of operations for migrating data from Magento 1.x to Magento 2.x. The Data Migration Tool divides the migration process into three phases or modes. It helps to transfer and adapt data from Magento 1.x to Magento 2.x. These modes must be executed in the following order:

  • Settings Mode: Migrate system configuration and website-related settings.

  • Data Mode: Transfer database assets in bulk.

  • Delta Mode: Migrate incremental changes that have occurred since the last run. Examples include new customers and orders.

2. Steps

Steps is a set of tasks within a mode that specify the types of data to be migrated. The Data Migration Tool employs a series of steps within each mode to migrate specific types of data.

For instance, in the Magento Settings mode, there are two steps to migrate all settings data:

  • The Stores step and the Settings step.

  • Detailed information about the data migrated in each step.

It includes those in other modes available in the Data Migration Tool Technical Specification.

3. Stages

Stages are tasks within a step that validate, transfer, and verify the data. Each step comprises three stages to ensure proper data migration:

  • Integrity Check: Compares table field names, types, and other details. It verifies compatibility between Magento 1 and Magento 2 data structures.

  • Data Transfer: Transfers the data table by table from Magento 1 to Magento 2.

  • Volume Check: Compares the number of records between tables. It confirms the transfer was successful.

4. Map files

Map files are XML files that outline the rules and connections to complete the stages. They help in managing altered field names and data transformations. At the core of the migration process are the XML map files. The Data Migration Tool utilizes these files within the stages of each step. It transforms data structures between Magento 1.x and 2.x tables. For instance, data migrates from Magento Open Source 1.8.0.0 database to Magento Open Source 2.x.x. The map file recognizes renamed tables. It adjusts them in the destination database accordingly. If there are no structural or format differences, the Data Migration Tool transfers the data as-is. It includes data from extension-created tables to the Magento 2 database.

5. Migration components

Magento 2 migration involves 4 key components:

i. Data

The Magento 2 Data Migration Tool facilitates the transfer of products, customers, order data, store configurations, promotions, and more to Magento 2. It provides detailed information on using the tool and best practices for data migration.

ii. Extensions and Custom Code

You can download or purchase the latest versions of any extension from the Commerce Marketplace. These extensions are designed to enhance the functionality of your Magento 2 store. Refer to the PHP Developer Guide for detailed information on developing extensions.

iii. Themes

Magento 2 employs new technologies and approaches. These include enhanced indexing, modular architecture, and advanced security. These advancements allow merchants to create innovative shopping experiences and scale their operations.

iv. Customizations

To leverage customization benefits, developers must update their themes and customizations. You can go through the comprehensive documentation for creating Magento 2 themes, layouts, and customizations.

Troubleshooting Common Solutions For The Data Migration Tool

Challenge Solution
Data integrity issues and constraint violations - Identify and remove duplicate records before migration
- Ensure all referenced data exists in Magento 1 (product attributes, categories, customers)
- Add any missing data dependencies
- Use the migration tool to validate and clean up data pre-migration
Missing data after migration - Check your version for any missing products, categories, or customers post-migration
- Verify mapping files include all necessary Magento 1 data
- Validate and fix Magento 1 data issues before migrating
Incompatible Magento 1 themes - Rebuild themes from scratch for Magento 2 architecture
- Purchase new Magento 2 compatible themes
- Clone and adapt Magento 1 design to Magento 2 standards
Magento 1 extensions not available for Magento 2 - Search for alternative Magento 2 extensions with similar features
- Develop custom extensions to replicate required functionality
Custom code compatibility - Refactor custom modules and scripts for Magento 2
- Thoroughly test customizations in the Magento 2 environment
- Hire experienced Magento 2 developers familiar with migrations
Slow migration process and performance - Optimize migration scripts and code
- Adjust PHP memory limits and execution time
- Use profiling tools to identify bottlenecks and slow queries
- Split large tables into smaller chunks for easier migration
- Perform the migration on a separate server to prevent affecting the live store
- Utilize techniques such as proper indexing and query optimization
Data security risks - Ensure secure transfer of data during migration
- Apply the latest security patches to the Magento store
- Implement Magento encryption, 2FA, proper file permissions post-migration
Inconsistencies between Magento 1 and 2 database structures - Check for convergence between database structures
- Analyze the tool's logs to identify any structural mismatches
- Modify database schemas or mapping files to align structures
- Re-run the tool's integrity checks to verify compatibility
Disruptions from ongoing Magento 1 activity during migration - Stop all Magento 1 cron jobs before starting the migration
- Avoid making admin changes, except for essential order management
- Freeze code deployments on Magento 1 during the migration process
- Prevent frontend changes or new data entry on Magento 1 during migration

FAQs

1. How does the Magento 2 data migration tool help move all of my products from my old store to a new one?

The data migration tool transfers your product data, customer information, and order history. It streamlines the Migration service process. Also, it reduces manual work and potential errors.

2. Can I use my Magento 1 extensions in Magento 2 after migration?

While the data migration tool transfers data, it does not convert extensions. You will need to find Magento 2 versions of your extensions or alternatives. Work hard with the development community to find compatible solutions.

3. Does the data migration tool support migration from other e-commerce platforms?

The official Magento 2 data migration tool is designed for Magento 1 to Magento 2 migrations. For MGT Commerce or WooCommerce, you'll need third-party tools or custom solutions.

4. What are the main steps involved in using the data migration tool?

The migration process involves 3 steps- Install Magento 2 and the data migration tool. Configure the tool with your Magento 1 and 2 database information. Run the migration commands to transfer your data.

5. Do I need to use the command line to run the data migration tool?

Yes, the data migration tool is primarily used through the command line interface. You will need to provide the location of your Magento installations. Also, you can run specific commands to initiate and control the migration process.

6. Will I need to make changes to my themes when migrating to Magento 2?

Yes, themes from Magento 1 are not directly compatible with Magento 2. You will need to either find a similar Magento 2 theme or work with a developer. Do this to adapt your existing theme to the new platform structure.

CTA

Summary

Developed for Magento version 2.2.0 and above, the data migration tool transfers your e-commerce data. Designed for the Magento platform, you can use this tool to move your store's information and do the following:

  • Verify consistency between Magento 1 and Magento 2 databases.

  • Log migration process and run verification tests.

  • Use the command-line interface for efficient data transfer.

  • Run migration commands and configure necessary files.

  • Perform integrity checks, backups, and verify data transfer.

Consider Magento optimised server to use Magento 2's advanced features with minimal disruption to your business operations.

Dikshya Shaw
Dikshya Shaw
Technical Writer

Dikshya leverages her content marketing and writing proficiency to deliver fresh, insightful content. Her meticulous research ensures industry expertise and emerging trends within the Magento landscape.


Get the fastest Magento Hosting! Get Started