This document describes scenarios for migrating data into TiDB from either MySQL or another data source via CSV format.
Migrations will often make use of the following tools. The following is a brief overview of their usage:
mydumperexports data from MySQL. It is recommended over using mysqldump.
loaderimports data in mydumper format into TiDB.
synceracts like a MySQL replication slave and pushes data from MySQL into TiDB.
The following example scenarios show how you can put to use the tools mentioned above.
To migrate the full data, you can use one of the following three solutions:
For detailed operations, follow the steps in Migrate Data from MySQL to TiDB.
To migrate the full data and then replicate data incrementally, you can use one of the following three solutions:
For detailed operations, follow the steps in Incremental Migration.
To import data from another database, it is recommended to:
For more information, refer to CSV support for TiDB-Lightning.