Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Latest commit

 

History

History
62 lines (48 loc) · 1.39 KB

create-task.md

File metadata and controls

62 lines (48 loc) · 1.39 KB
title summary
Create a Data Migration Task
Learn how to create a data migration task in TiDB Data Migration.

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.

{{< copyable "" >}}

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

{{< copyable "" >}}

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

{{< copyable "" >}}

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