This topic describes how to use the data migration service to migrate data from a PolarDB-X 2.0 database to an OceanBase Database tenant in MySQL mode.
Prerequisites
You have created a source PolarDB-X 2.0 instance and a destination OceanBase Database tenant in MySQL mode.
You have prepared source and destination database accounts with the required connection and migration privileges.
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 PolarDB-X 2.0 data sources and OceanBase data sources.
If incremental synchronization is required, the source database meets the Binlog requirements for incremental synchronization.
Limits
PolarDB-X 2.0 data sources support only Alibaba Cloud.
The supported source version is PolarDB-X 2.0.
The destination supports only transactional and Flagship cluster instances of OceanBase Database in MySQL mode. Analytical cluster instances and self-managed databases are not supported.
Schema migration, full migration, and incremental synchronization are supported. Full verification and reverse incremental synchronization are not supported.
Incremental synchronization supports only DML operations, including
INSERT,UPDATE, andDELETE. DDL operations are not supported.Full verification, row count verification, and incremental verification tasks cannot be created for this migration scenario.
Source and destination instance types
Endpoint |
Database type |
Instance type |
|---|---|---|
| Source | PolarDB-X 2.0 | Alibaba Cloud PolarDB-X 2.0 |
| Destination | OceanBase MySQL Compatible | Cluster instance (transactional) or cluster instance (Flagship) |
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 Alibaba Cloud. Region Select the region in which the source PolarDB-X 2.0 instance is deployed. Database type Select PolarDB-X 2.0. Instance type Select Alibaba Cloud PolarDB-X 2.0. 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 PolarDB-X 2.0 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 PolarDB-X 2.0 instance over that connection. For a public network connection, you must also add the IP address displayed on the page to the instance allowlist. Port Enter the actual port of the endpoint service or PolarDB-X 2.0 instance based on the selected connection type. Account Enter the source PolarDB-X 2.0 migration account. Password Enter the password of the source migration account. For information about the prerequisites and parameters of the three connection types, see PolarDB-X 2.0 data sources.
Configure the destination.
ParameterDescriptionCloud provider Select Alibaba Cloud. Region Select the region in which the destination OceanBase Database is deployed. Database type Select OceanBase MySQL Compatible. Instance type Select Cluster instance (Transactional) or Cluster instance (Flagship). Instance Select the instance that contains the destination tenant. Tenant Select the destination tenant in MySQL mode. Account Select the destination migration account. Password Enter the password of the destination migration account.
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 source table schemas to the destination. Full migration Migrates existing data in the source tables to the corresponding destination tables. Incremental synchronization Continuously synchronizes data inserted, updated, or deleted at the source. After you select Incremental Synchronization, only DML Synchronization is available.
INSERT,UPDATE, andDELETEoperations are synchronized by default. You can modify the synchronized operations as needed. For more information, see Customize DML and DDL synchronization. DDL synchronization, full verification, and reverse incremental synchronization are not supported for this migration scenario.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.
- If you select matching rules, enter a migration object rule and, optionally, an exclusion rule. Click Validate. After validation succeeds, preview the final, added, and removed objects matched by the rules, and then click Next. For more information, see Configure matching rules.
Configure the object settings as needed.
OperationDescriptionRename Changes the destination database or table name. For more information, see Rename databases and tables. If you select objects by using matching rules, configure name mappings in the rules. Row filter Uses a WHEREcondition to filter data. For more information, see Filter data by SQL conditions.
Click Next to go to the Migration Options page. Configure the displayed concurrency and speed limit parameters as needed, or retain the default settings.
After you configure the migration options, click Precheck.
After the precheck succeeds, follow the on-screen instructions to start the data migration task.
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.
