DM Task Migration

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: dm 任务迁移

| username: Hacker_suny

[TiDB Usage Environment] Production Environment
[TiDB Version] v4.0.0
[Reproduction Path] None
[Encountered Problem: Problem Phenomenon and Impact]
I currently have two DM clusters (dm-A, dm-B). I want to migrate the tasks running on dm-A to dm-B, but I don’t know how to proceed. Could the experts please recommend the steps for this operation?

| username: ffeenn | Original post link

Refer to this
TiDB Data Migration Export and Import Cluster Data Source and Task Configuration | PingCAP Documentation Center

| username: Hacker_suny | Original post link

This is just the data source and task configuration that were exported. However, when this task is re-imported into dm-B, it will pull the data from the beginning again, not incrementally.

| username: ffeenn | Original post link

Indeed it is.

| username: okenJiang | Original post link

You should be able to directly stop task/start task:

  1. Pause/stop the task of dm-A.
  2. Start the task of dm-B, change the mode to incremental only, and it’s best not to modify the previous task configuration, do not remove-meta.

If you are really worried, you can:

  1. Pause/stop the task of dm-A.
  2. Record the current binlog position as binlog-A.
  3. Start the task of dm-B (incremental only) and set the task to start from binlog-A.

Reference documentation: DM 任务完整配置文件介绍 | PingCAP 文档中心

meta:                                   # The starting position of binlog migration when `task-mode` is `incremental` and the downstream database's `checkpoint` does not exist; if the checkpoint exists, it will be based on the `checkpoint`. If neither the `meta` item nor the downstream database's `checkpoint` exists, the migration will start from the latest binlog position of the upstream.

If you want to be more cautious, you can move the binlog position a bit earlier and set the safe-mode-duration to a larger value.

| username: Hacker_suny | Original post link

Later, I did it this way, but I didn’t set the safe-mode-duration. I directly took the position from dm_meta. Actually, thinking about it later, I could have just taken the binlog position from the dm-A task.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.