| title | TiDB Data Migration 导出和导入集群的数据源和任务配置 |
|---|---|
| summary | 了解 TiDB Data Migration 导出和导入集群的数据源和任务配置。 |
config 命令用于导出和导入集群的数据源和任务配置。
注意:
对于 v2.0.5 版本之前的集群,可使用 >= v2.0.5 且 < v8.0.0 的 dmctl 导出和导入集群的数据源和任务配置文件。
{{< copyable "" >}}
» help config
Commands to import/export config
Usage:
dmctl config [command]
Available Commands:
export Export the configurations of sources and tasks.
import Import the configurations of sources and tasks.
Flags:
-h, --help help for config
Global Flags:
-s, --source strings MySQL Source ID.
Use "dmctl config [command] --help" for more information about a command.使用 export 子命令导出集群的数据源和任务配置到指定文件夹中。
{{< copyable "" >}}
config export [--dir directory]dir:- 可选
- 指定导出文件夹路径
- 默认值为
./configs
{{< copyable "" >}}
config export -d /tmp/configsexport configs to directory `/tmp/configs` succeed
使用 import 子命令从指定文件夹中导入集群的数据源和任务配置。
{{< copyable "" >}}
config import [--dir directory]注意:
对于 v2.0.2 版本之后的集群,暂不支持自动导入 relay worker 的相关配置,可以手动使用
start-relay命令开启 relay log。
dir:- 可选
- 指定导入文件夹路径
- 默认值为
./configs
{{< copyable "" >}}
config import -d /tmp/configsstart creating sources
start creating tasks
import configs from directory `/tmp/configs` succeed