Close [x]

Migrating data

When you migrate data, the Data Migration Tool verifies that tables and fields are consistent between Magento 1 and Magento 2. If not, an error displays that lists the problematic tables and fields. These entities, for example, can belong to some extensions from Magento 1 that do not exist in the Magento 2 database.

If you encounter such an error, you can:

  • Install the corresponding extensions in Magento 2 if they exist
  • Ignore them by adding <ignore> tags to the map.xml file

After resolving issues, run the Data Migration Tool again.

First steps

  1. Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. One way to do this is to switch to the Magento file system owner.

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

    su <Magento file system owner> -s /bin/bash -c <command>
    
  2. To run Magento commands from any directory, add <your Magento install dir>/bin to your system PATH.

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

    bash shell example for CentOS:

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

You can also run the commands in the following ways:

  • cd <your Magento install dir>/bin and run them as ./magento <command name>
  • php <your Magento install dir>/bin/magento <command name>

<your Magento install dir> is a subdirectory of your web server's docroot. Need help locating the docroot? Click here.

In addition to the command arguments discussed here, see Common arguments.

Run the data migration command

To migrate data, use the following command:

Command usage:

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

where

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

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

The Data Migration Tool saves its current progress as it runs. If errors or user intervention stop it from running, the Data Migration Tool resumes progress at the last known good state.

To force the Data Migration Tool to run from the beginning, use the --reset argument. In that case, we recommend you restore your Magento 2 database dump to prevent duplicating previously migrated data.