Data migration is a common operation in daily O&M tasks, essential for adjusting cluster load and relocating data centers. While operations such as data archiving within the cluster, data balancing between tables, and migration of resource units can be quickly initiated through simple commands in OceanBase Database, external tools are required for tasks involving heterogeneous data sources and data synchronization between clusters.
This chapter introduces several commonly used data migration methods and tools.
Application scenarios
Data migration is a common operation in database O&M and is typical in the following scenarios:
- Cluster load adjustment and IDC relocation
- Data export to files and data import from files to databases
- Database replacement
- Database logical replication, including read/write splitting, database disaster recovery, and multi-site high availability
- Business data replication
Migration plans
OceanBase Database provides various data migration and replication methods, including:
Migrate data by using OceanBase Migration Service (OMS) (recommended)
Migrate data by using obloader and obdumper
- Import data by using obloader
- Export data by using obdumper
Migrate data by using SQL scripts
Migrate data by using MyDumper
Migrate data by using DataX
Migrate data by using an OUTFILE statement
Migrate data by using DBCAT
Note
You can also use the backup and restore feature to migrate data of an OceanBase tenant. For more information about the backup and restore feature of OceanBase Database, see Introduction to physical backup and restore.
The following table lists the migration plans supported by OceanBase Database:
| Migration plan | Schema migration | Full data migration | Incremental data migration | Data verification | Supported data sources |
|---|---|---|---|---|---|
| OMS | Supported | Supported | Supported | Supported | OceanBase MySQL Oracle PostgreSQL DB2_LUW TiDB Kafka RocketMQ DataHub |
| obloader and obdumper | Supported | Supported | Not supported | Not supported | OceanBase Database |
| SQL scripts | Supported | Supported | Not supported | Not supported | Mainstream databases. Data migration across instances is not supported. |
| MyDumper | Supported | Supported | Not supported | Not supported | Data sources compatible with MySQL |
| DataX | Not supported | Supported | Not supported | Not supported | Various data sources. See the official documents for details. |
| OUTFILE statements | Not supported | Supported | Not supported | Not supported | MySQL OceanBase Database |
| DBCAT | Supported | Not supported | Not supported | Not supported | Various data sources. See the official documents for details. |