TiDB is MySQL-compatible, which means most applications can migrate with minimal changes. The standard migration path uses Dumpling to export data and TiDB Lightning to import it at high speed.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pingcap/tidb/llms.txt
Use this file to discover all available pages before exploring further.
Migration workflow
Assess compatibility
Review your schema and queries for any MySQL features TiDB handles differently — foreign key enforcement, auto-increment behavior, and certain system variables. Run your application test suite against TiDB first.
Export from MySQL with Dumpling
Dumpling exports data from MySQL (or MariaDB) as SQL or CSV files.For large databases, export specific databases with
--filter:Import into TiDB with TiDB Lightning
TiDB Lightning imports the exported files into TiDB at high speed.Minimal
tidb-lightning.toml:tidb-lightning.toml
Continuous replication with DM
For zero-downtime migrations, use TiDB Data Migration (DM) to replicate changes from MySQL to TiDB in real time while you migrate.- One-time migration
- Continuous replication
Use Dumpling + TiDB Lightning for a one-time bulk import. Suitable when you can afford a maintenance window.
- Fast: Lightning physical mode can import hundreds of GB per hour
- Simple: no ongoing replication to manage
- Best for: new projects, smaller datasets, scheduled migrations
TiDB Lightning import modes
Physical Import Mode
Directly ingest SST files into TiKV. Fastest option — suitable for initial bulk loads. Requires exclusive access to the target table.
Logical Import Mode
Uses SQL INSERT statements. Slower but works with a live cluster and concurrent writes. Use
backend = "tidb" in config.Physical import mode (
backend = "local") is recommended for large datasets. For tables already in production use, switch to logical mode (backend = "tidb").