When the data migration task is in the
Sync stage, if you add additional tables to the configuration file and restart the task, DM does not re-execute full export and import for the newly added tables. Instead, DM continues incremental replication from the previous checkpoint.
Therefore, if the full data of the newly added table has not been imported to the downstream, you need to use a separate data migration task to export and import the full data to the downstream.
Record the position information in the global checkpoint (
is_global=1) corresponding to the existing migration task as
checkpoint-T, such as
(mysql-bin.000100, 1234). Record the position information of the full export
metedata (or the checkpoint of another data migration task in the
Sync stage) of the table to be added to the migration task as
checkpoint-S, such as
(mysql-bin.000099, 5678). You can add the table to the migration task by the following steps:
stop-taskto stop an existing migration task. If the table to be added belongs to another running migration task, stop that task as well.
Use a MySQL client to connect the downstream TiDB database and manually update the information in the checkpoint table corresponding to the existing migration task to the smaller value between
checkpoint-S. In this example, it is
(mysql- bin.000099, 5678).
The checkpoint table to be updated is
The checkpoint rows to be updated match
The checkpoint columns to be updated are
safe-mode: truefor the
syncersin the task to ensure reentrant execution.
Start the task using
Observe the task status through
syncerBinlogexceeds the larger value of
safe-modeto the original value and restart the task. In this example, it is