Close [x]

Migrate using the data migration tool

Edit this page on GitHub

Contents

General rules for successful migration

During the time you鈥檙e migrating:

  • Do not make any changes in the Magento 1 Admin except for order management (shipping, creating invoice, credit memos etc.)
  • Stop all Magento 1 cron jobs
  • Do not alter any code
  • Do not make changes in the Magento 2 Admin and storefront

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

Run the Data Migration Tool

This section discusses how to run the migration tool to migrate settings, data, or incremental changes.

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.

Command syntax

Command syntax:

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

where

<mode> is settings, data, or delta

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

Logs are written to the <your Magento install dir>/var/ directory.

The following sections should be performed in a specific order:

  1. Migrate settings
  2. Migrate data
  3. Migrate changes