This topic describes how to use the data migration service to migrate data from OceanBase Database in MySQL mode to AnalyticDB for MySQL (ADB).
Prerequisites
You have created a source tenant in MySQL mode and a destination ADB instance.
If you want to migrate schemas, you have created the corresponding databases in the destination ADB instance.
You have prepared database accounts that can connect to the source and destination databases.
You have prepared the source and destination connection information and configured the required network connections and allowlists. You can create and test the data sources in advance. For more information, see OceanBase data sources and ADB data sources.
Limits
Only cluster instances are supported. Shared instances are not supported.
The supported destination version is ADB 3.0.
Tables without primary keys cannot be migrated. The system handles these tables as follows in different scenarios:
- Table migration or object selection based on matching rules: The system automatically filters out tables without primary keys and does not add them to the migration scope.
- Full database migration: If the source database contains a table without a primary key, schema migration fails because ADB cannot create the table.
- A table without a primary key is created during incremental synchronization: The synchronization task fails because ADB cannot create the table, regardless of whether full database migration or matching rules are used to select objects.
Schema migration, full migration, and incremental synchronization are supported. Incremental synchronization supports both DML and DDL operations.
Full verification and reverse incremental synchronization are not supported.
Data verification tasks cannot be created for this migration scenario.
Deferred index creation is not available in the migration options.
Column selection is not available in the object settings.
Source and destination instance types
Endpoint |
Database type |
Instance type |
|---|---|---|
| Source | OceanBase MySQL Compatible | Cluster instance (transactional), cluster instance (analytical), cluster instance (Flagship), or self-managed database |
| Destination | AnalyticDB for MySQL (ADB) | Alibaba Cloud AnalyticDB for MySQL |
Procedure
Create a data migration task.
- Log in to the OceanBase Cloud console.
- In the left-side navigation pane, choose Data Services > Data Migration.
- On the Data Migration tab, click Create Migration Task.
Enter a custom name for the migration task.
We recommend that you use a combination of letters and digits. The name cannot contain spaces and must not exceed 64 characters in length.
On the Configure Source and Destination page, configure the source and destination.
In the source or destination section, you can click Reference Data Source and select a saved data source to automatically populate the configuration. After you manually enter the connection information, you can also click the Save icon in the upper-right corner of the corresponding section to save the configuration as a data source.
Configure the source.
ParameterDescriptionCloud provider Select the cloud provider on which the source OceanBase Database is deployed. The available options are Alibaba Cloud, AWS, and Google Cloud. Region Select the region in which the source database is deployed. Database type Select OceanBase MySQL Compatible. Instance type Select Cluster instance (Transactional), Cluster instance (Analytical), Cluster instance (Flagship), or Self-managed database. Instance If you select a cluster instance, select the instance that contains the source tenant. Tenant If you select a cluster instance, select the source tenant in MySQL mode. Account Select or enter the source migration account. Password Enter the password of the source migration account. If you select Self-managed database, you must also configure the connection information displayed on the page.
Configure the destination.
ParameterDescriptionCloud provider Select Alibaba Cloud. Region Select the region in which the destination ADB instance is deployed. Database type Select AnalyticDB for MySQL (ADB). Instance type Select Alibaba Cloud AnalyticDB for MySQL. Connection type Select Private network connection, Public network connection, or Peering connection. Endpoint service ID This parameter is required for a private network connection. Enter the endpoint service ID used to access the ADB instance. You can click How to get it for instructions. Peering connection ID If you select a peering connection, select an available peering connection from the drop-down list. Connection information If you select a public network or peering connection, enter the IP address or hostname used to access the ADB instance over that connection. For a public network connection, you must also add the IP address displayed on the page to the allowlist of the ADB instance. Port Enter the actual port of the endpoint service or ADB instance based on the selected connection type. Account Enter the destination ADB migration account. Password Enter the password of the destination migration account. For information about the prerequisites and parameters of the three connection types, see ADB data sources.
Click Test Connection and Proceed.
On the Select Type and Objects page, configure the migration types and objects.
Select the migration types.
Migration typeDescriptionSchema migration Migrates the schemas of the source database to ADB. Full migration Migrates existing data in the source tables to the corresponding destination tables. Incremental synchronization Continuously synchronizes subsequent changes from the source. Both DML and DDL synchronization are supported. For more information, see Customize DML and DDL synchronization. After you select Incremental Synchronization, you can configure the following synchronization scopes:
- DML Synchronization: Supports
INSERT,UPDATE, andDELETEoperations. - DDL Synchronization: Supports
CREATE,ALTER,DROP,RENAME, andTRUNCATEoperations on tables, andCREATEandDROPoperations on indexes. Before you modify the synchronization scope, you can click View supported DDL for more information.
Full verification and reverse incremental synchronization are not supported for this migration scenario.
- DML Synchronization: Supports
Select the migration objects.
Specified Objects and Matching Rules are supported. If you select specified objects, select the objects on the Table Migration or Full Database Migration tab. Select the objects to migrate in the source object list and click > to add them to the selected object list. For information about how to use matching rules, see Configure matching rules.
After you enable DDL synchronization, we recommend that you use matching rules or full database migration to include objects that are subsequently created or renamed. If you use table migration to select specified objects, subsequently created or renamed objects are not automatically added to the migration scope.
Configure object mappings and ADB table settings as needed.
OperationDescriptionRename Changes the destination database or table name. For more information, see Rename databases and tables. Row filter In Settings, use a WHEREcondition to filter data. For more information, see Filter data by SQL conditions.Push down filter conditions Pushes row filter conditions down to the source database as needed. Before you enable this feature, make sure that appropriate indexes are available for the filter conditions in the source database. Primary key In Settings, view or modify the primary key of the destination table. Distribution key Configure a distribution key as needed. Partition key and lifecycle Enable partition key settings, and then enter a partition key expression and lifecycle. Remove object Removes one or all objects that you do not want to migrate. Column selection is not available in the object settings.
Click Next. On the Migration Options page, configure the parameters.
Full migration options
The following parameters are displayed when you select full migration.
ParameterDescriptionRead concurrency Configure the concurrency for reading data from the source. Write concurrency Configure the concurrency for writing data to the destination. Write method SQL write writes data to ADB by using SQL statements. Direct load imports full data through the direct load mechanism. Limit full migration speed Enable this option as needed, and configure the source read and destination write RPS and BPS limits. RPS limits the number of rows processed per second. BPS limits the amount of data processed per second. Policy for records that already exist in destination tables Select Stop Migration or Ignore. Incremental synchronization options
The following parameters are displayed when you select incremental synchronization.
ParameterDescriptionWrite concurrency Configure the concurrency for writing data to the destination during incremental synchronization. Limit incremental migration speed Enable this option as needed, and configure the destination write RPS and BPS limits. Start point of incremental synchronization This parameter cannot be modified if full migration is selected.
After you configure the migration options, click Precheck.
After the precheck succeeds, click Purchase to go to the Purchase Data Migration Instance page.
After the purchase is complete, you can start the data migration task. For more information, see Purchase a data migration instance. If you do not want to make the purchase immediately, click Save and continue the purchase later from the task details page.
After the task starts, monitor the migration progress and synchronization latency, and verify the destination data. For more information, see View the details of a data migration task.
