Pause a Data Migration Task

You can use the pause-task command to pause a data migration task.

pause-task differs from stop-task in that:

  • pause-task only pauses a migration task. You can query the status information (retained in the memory) of the task using query-status. stop-task terminates a migration task and removes all information related to this task from the memory. This means you cannot use query-status to query the status information. dm_meta like “checkpoint” and data that have been migrated to the downstream are not removed.
  • If pause-task is executed to pause the migration task, you cannot start a new task with the same name, neither can you get the relay log of the paused task removed, since this task does exist. If stop-task is executed to stop a task, you can start a new task with the same name, and you can get the relay log of the stopped task removed, since this task no longer exists.
  • pause-task is usually used to pause a task for troubleshooting, while stop-task is to permanently remove a migration task, or to co-work with start-task to update the configuration information.
  1. help pause-task
  1. pause a specified running task
  2. Usage:
  3. dmctl pause-task [-s source ...] <task-name | task-file> [flags]
  4. Flags:
  5. -h, --help help for pause-task
  6. Global Flags:
  7. -s, --source strings MySQL Source ID

Usage example

  1. pause-task [-s "mysql-replica-01"] task-name

Flags description

  • -s: (Optional) Specifies the MySQL source where you want to pause the subtasks of the migration task. If it is set, this command pauses only the subtasks on the specified MySQL source.
  • task-name| task-file: (Required) Specifies the task name or task file path.

Returned results

  1. pause-task test
  1. {
  2. "op": "Pause",
  3. "result": true,
  4. "msg": "",
  5. "sources": [
  6. {
  7. "result": true,
  8. "msg": "",
  9. "source": "mysql-replica-01",
  10. "worker": "worker1"
  11. }
  12. ]
  13. }