Skip to content

4. CLI Mode Quick Guide#

This chapter provides a quick step guide for CLI mode users who are new to Migration Center.

Quick Step Guide for CLI User#

The user can easily perform migration in CLI mode with this quick step guide. The overall process is listed below.

  1. Prepare the project
  2. Register database connection information and project
  3. Set migration options
  4. Build the project
  5. Reconcile the project
  6. Run the project
  7. Validate the project

Prepare the Project#

The source/destination database connection information and project registration are essential to perform migration. It is possible to register the project in CLI mode, but it is recommended to register in user-friendly in GUI mode.

To register the database connection information and projects in CLI mode, you must explicitly register it in Migration Center after modifying the registration file(register.xml). What you need to input in the registration file is the project name and the source / destination database connection information to be used in the project. Multiple projects can be registered at once.

The registration file must be located in the directory where the Migration Center is installed. Please refer to the comments and samples in the "register.xml" file for more details.

Registering database connection information and project#

% ./migcenter.sh register register.xml

The source/destination database connection information and the project recorded in the registration file (register.xml) is to be registered in the Migration Center. The input project name should be unique, and the database connection information should be able to connect to the target database before registrations. When the project is successfully registered, the project name folder is automatically created and source/destination database connect information is stored in Migration Center.

If either the project recorded in the registration file or the registration of the database connection information fails, all project and database connection registration recorded in the registration file are canceled.

The user can use a name other than "register.xml" as the name of the registration file.

Setting Migration Options#

The "options.xml" file is automatically created in the project folder when the project is registered. You can modify the options in the options.xml file directly in CLI mode. For details of the options, refer to the "Appendix A: Migration Options".

Building the Project#

% ./migcenter.sh build project_path

To perform the "Build" step, input the build command and the path of the target project. The number of table records in the source database is collected using the Approximate Counting Method by default.

Reconciling the Project#

% ./migcenter.sh reconcile project_path

To perform the "Reconcile" step, input the reconcile command and the path of the target project. In CLI mode, user is not allowed to tune the "Reconcile" step due to the limit of character-based interface.

When extracting data from the source database, users can selectively migrate only the data that meets specific conditions. Please refer to 5.Migration Center Internals - "Select Editing" Step for more information.

Running the Project#

% ./migcenter.sh run project_path

To perform the "Run" step, input the run command and the path of the target project.

Validating the Project#

% ./migcenter.sh diff project_path

To verify the data migrated properly in the "Run" step, input the diff command and the path of the target project.

% ./migcenter.sh filesync project_path

To match the different data between the source and destination databases using the diff command, input filesync command and the path of the target project.