Data migration refers to the process of moving data from a source system to OceanBase Database, used for database replacement, version upgrade, data warehouse integration, and more.
Migration Phases
Data migration is typically planned in the order of "data structure → full data → incremental data" (though these phases can partially overlap, subject to the tool and window availability):
Phase |
Target |
Common methods |
Typical Tools and Methods |
|---|---|---|---|
| Schema Migration | The target database has the same database tables, indexes, and constraints (and necessary partitioning strategies) as the source database. | DDL conversion, data type and character set mapping, and incompatible syntax rewriting | OMS (Object Synchronization), DBCAT (Table Schema), Manual DDL |
| Full migration | Complete the Historical Data Baseline by the scheduled time. | Batch import and export, parallel splitting, and direct load | OMS, obloader + direct load, DataX, MyDumper + import, LOAD DATA (MySQL-compatible mode) / LOAD DATA (Oracle-compatible mode) |
| Incremental migration | After full synchronization is complete, continuous change synchronization continues until switchover or long-term dual-active deployment. | Log parsing (Binlog/Redo, etc.), latency tracking, conflict and re-feed strategies | OMS, Canal, Flink CDC, and others |
Note: If the AP side primarily consumes files/offline data warehouses, common approaches are pre-aligning structures and loading full files into OceanBase. Whether to run incremental migration separately depends on whether continuous alignment is needed. For details, see Data Subscription Overview and Data Synchronization Overview.
Heterogeneous Database Migration
Migration Scenarios
Heterogeneous data migration is mainly applicable to the following scenarios:
- Database Upgrade or Replacement: Migrate an existing database system to OceanBase to achieve better performance, scalability, or cost-effectiveness.
- Data Consolidation: Integrate data from multiple different database systems into a unified OceanBase platform.
- Architecture Upgrade: Migrate from a traditional database to a distributed database architecture.
In these data migration scenarios, focus on:
- Schema and Data Type Mapping: Precisely define the data structure and type mapping rules between the source and target (OceanBase).
- Performance Optimization: For migrating massive amounts of data, adopt efficient migration strategies such as parallel processing, sharded migration, and batch loading to shorten the migration window.
- Data Consistency Verification: After migration completion, ensure data integrity and accuracy through methods like hash verification, sampling comparison, or full comparison.
MySQL to OceanBase
Oracle to OceanBase
Method |
References |
|---|---|
| OMS (MySQL-compatible mode tenant) | Use OMS to migrate data from an Oracle database to an OceanBase database (MySQL-compatible tenant) |
| OMS (Oracle-compatible mode tenant) | Use OMS to migrate data from an Oracle database to an OceanBase database (Oracle-compatible tenant) |
| DBCAT | Use DBCAT to migrate data from an Oracle database to OceanBase Database |
| DataX | Use DataX to migrate data from an Oracle database to OceanBase Database |
Other Data Sources to OceanBase
data source |
References |
|---|---|
| PostgreSQL | Use OMS to migrate data from a PostgreSQL database to an OceanBase Database tenant in MySQL-compatible mode |
| DB2 LUW (MySQL-compatible mode tenant) | Use OMS to migrate data from a DB2 LUW database to an OceanBase database (MySQL-compatible tenant) |
| DB2 LUW (Oracle compatible mode tenant) | Use OMS to migrate data from a DB2 LUW database to an Oracle-compatible tenant of OceanBase Database |
| DB2 LUW (table structure) | Use DBCAT to migrate table structures from a DB2 LUW database to OceanBase Database |
| TiDB | Use OMS to migrate data from a TiDB database to an OceanBase Database tenant in MySQL-compatible mode |
Homogeneous Database Migration
Migration Scenarios
Homogeneous data migration is mainly applicable to the following scenarios:
- Version Upgrade: Migrate data from an old version of an OceanBase cluster to a new version to obtain new features or improve performance.
- Migration Between TP and AP Databases: Migrate data from an OceanBase Transactional (TP) database to an Analytical (AP) database to support real-time analytics or BI applications.
Since both the source and target are OceanBase, data format conversion is usually not required for this type of migration. However, the following considerations remain:
- Data consistency during migration: Ensure data consistency during migration through transaction logging or snapshot mechanisms.
- Downtime control: Select an appropriate migration plan based on business RTO/RPO requirements to minimize or avoid service interruptions.
- Version compatibility: Pay attention to subtle differences in SQL syntax, system parameters, or internal implementations between different versions when migrating across versions.
Migration between OceanBase tenants
Scenario |
References |
|---|---|
| Tenant to Tenant in MySQL Compatibility Mode |
|
| MySQL-compatible mode tenant to Oracle-compatible mode tenant | |
| Tenant to tenant in Oracle compatible mode |
|
| Tenant in Oracle compatible mode to tenant in MySQL compatible mode |
Big data ecosystem integration
Migration scenarios
- Synchronize offline data warehouse data to real-time analytics systems: Synchronize data from offline data warehouses such as Hive or Spark to real-time data processing platforms (such as Flink or Kafka) to support real-time data processing and streaming analysis.
- Archive offline data to long-term storage: Archive historical data from offline data warehouses to long-term storage (such as cloud object storage S3 or Alibaba Cloud OSS) to reduce storage costs and meet data retention policies.
- Import offline data into OceanBase Database: Migrate or synchronize data from offline data warehouses such as Hive to OceanBase to support unified analysis, data services, or integration with business data.
In these data migration scenarios, pay attention to the following:
- Source data format adaptation to target tables: Check whether the source file format (such as CSV, Parquet, or ORC) matches the column types, precision, time formats, partition fields, etc., of the OceanBase target table. If necessary, perform field mapping and type conversion during table creation or import.
- Efficient transmission of massive data: Use distributed tools such as DistCp to improve transmission efficiency through parallel processing and network optimization.
- Metadata and table structure alignment: Ensure that the source table definition, partition information, and schema match those of the OceanBase AP target table (column names, types, partitioning strategies), avoiding mismatched target table structures after only migrating data.
data source |
Documentation |
|---|---|
| Hive | Use OMS Community Edition to migrate Hive, Use obloader to migrate Hive |
| HBase | Use OMS Community Edition to migrate HBase |
| ORC files, Parquet files, and CSV files | Use obloader to migrate files in ORC, Parquet, or CSV formats |
| AnalyticDB for MySQL (Alibaba Cloud) | Import data from an AnalyticDB for MySQL database to a MySQL-compatible tenant of OceanBase Database |
