Migrate using Data Migration Tool

General rules for successful migration

Before you start migration, stop all Magento 1 cron jobs.

During the migration process, do not:

  1. Make any changes in the Magento 1 Admin except for order management (shipping, creating invoice, credit memos, etc.)

  2. Alter any code

  3. Make changes in the Magento 2 Admin and storefront

All operations in Magento 1 storefront are allowed at this time.

Run Data Migration Tool

This section shows how to run the Data Migration Tool to migrate settings, data, or incremental changes.

First steps

  1. Log in to the Magento server as, or switch to, a user with permissions to write to the Magento file system. See switch to the Magento file system owner.

    If you use the bash shell, you can use the following syntax to switch to the Magento file system owner and enter the command at the same time:

    1
    
    su <Magento file system owner> -s /bin/bash -c <command>
    

    If the Magento file system owner does not allow logins, you can do the following:

    1
    
    sudo -u <Magento file system owner>  <command>
    
  2. To run Magento commands from any directory, add <magento_root>/bin to your system PATH.

    Because shells have differing syntax, consult a reference like unix.stackexchange.com.

    Sample bash shell for CentOS:

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

    Optionally, you can run the commands in the following ways:

    • cd <magento_root>/bin and run them as ./magento <command name>
    • <magento_root>/bin/magento <command name>
    • <magento_root> is a subdirectory of your web server docroot. Need help locating the docroot?

In addition to the command arguments mentioned here, see Common arguments

Command syntax

Below is a typical command example:

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

where:

  1. <mode> may be: settings, data, or delta

  2. [-r|--reset] is an optional argument that starts migration from the beginning. You can use this argument for testing migration.

  3. {<path to config.xml>} is the absolute file system path to config.xml; this argument is required.

Logs are written to the <magento_root>/var/ directory.

Migration order

When we created the Data Migration Tool, we assumed the following data transfer sequence:

  1. Settings
  2. Data
  3. Changes

That’s why we strongly recommend to keep this order to migrate quickly and with no issues.