Important

You are viewing the documentation of an older version of the TiDB database (TiDB v5.4).

It is recommended that you use the latest LTS version of the TiDB database.

Create a Data Migration Task

You can use the start-task command to create a data migration task. When the data migration task is started, DM prechecks privileges and configurations.

help start-task
Starts a task as defined in the configuration file
Usage:
  dmctl start-task [-s source ...] [--remove-meta] <config-file> [flags]
Flags:
  -h, --help          Help for start-task
      --remove-meta   Whether to remove task's metadata
Global Flags:
  -s, --source strings   MySQL Source ID

Usage example

start-task [ -s "mysql-replica-01"] ./task.yaml

Flags description

  • -s: (Optional) Specifies the MySQL source to execute task.yaml. If it is set, the command only starts the subtasks of the specified task on the MySQL source.
  • config-file: (Required) Specifies the file path of task.yaml.
  • remove-meta: (Optional) Specifies whether to remove the task's previous metadata when starting the task.

Returned results

start-task task.yaml
{
    "result": true,
    "msg": "",
    "sources": [
        {
            "result": true,
            "msg": "",
            "source": "mysql-replica-01",
            "worker": "worker1"
        }
    ]
}
Was this page helpful?