CloudCanal is a data migration and synchronization tool that helps enterprises quickly build a high-quality data channel. CloudCanal supports two modes: SaaS and private. The core members of the development team are database veterans from major database companies. They built database kernels, large distributed databases, and cloud products, and they know well about databases, distributed systems, and the business and service modes of cloud products.
This topic describes how to use Cloud Canal Community Edition V2.2.5.36 to synchronize data from a MySQL database to OceanBase Database in MySQL mode.
Applicability
- Since V2.2.0.7, CloudCanal Community Edition supports data migration from a MySQL database to OceanBase Database in MySQL mode. For more information, see the release note for CloudCanal V2.2.0.7.
- In CloudCanal, you can select a MySQL database whose version is V5.6 or later as the source database.
Prerequisites
You have installed and deployed CloudCanal Community Edition and obtained and activated a free license. For more information, see Install and deploy CloudCanal on Linux and macOS.
Migration procedure
- Add a data source.
- Create a task.
- View the task status.
Add a data source
Log on to CloudCanal.
Go to the data source management page and click Add Data Source.
On the Add Data Source page, specify the information about the data source.
Deployment Type: Select Self-managed Database or Alibaba Cloud.
- Alibaba Cloud: the database instance purchased on Alibaba Cloud.
- Self-managed Database: the database instance that you deployed on your own.
Database Type: the data source type. For more information about the data sources supported by CloudCanal Community Edition, see Features.
Add a MySQL data source and an OceanBase data source as the source and destination databases for synchronization.
Select Self-managed Database for Deployment Type and MySQL for Database Type to add the MySQL database instance that you deployed.
MySQL data source settings:
- Network Address: the IP address of the MySQL database.
- Authentication Method: the authentication method. Valid values: Account and Password, Account without Password, and No Account and Password. By default, Account and Password is selected.
- Account: the username for logging on to the MySQL database.
- Password: the password corresponding to the username for logging on to the MySQL database.
- Description: the description of the database. Specify a name that is easy to remember and identify, such as transaction database, user database, or test database. This field is optional.
Select Self-managed Database for Deployment Type and OceanBase for Database Type to add the OceanBase database instance that you deployed.
OceanBase data source settings:
- Network Address: the IP address for connecting to the OceanBase database directly or by using OceanBase Database Proxy (ODP).
- oblogproxy host: the IP address of oblogproxy. This parameter is required when an OceanBase database serves as the source database for incremental synchronization. It is optional when an OceanBase database serves as the destination database.
- OceanBaseRpcPort: the RPC port of the OceanBase database. Default value: 2882.
- Authentication Method: the authentication method. Valid values: Account and Password, Account without Password, and No Account and Password. Default value: Account and Password.
- Account: the username for logging on to the OceanBase database. If you directly connect to the OceanBase database, the username is in the Username@Tenant name format. If you connect to the OceanBase database using ODP, the username is in the Username@Tenant name#Cluster name format.
- Password: the password corresponding to the username for logging on to the OceanBase database.
- Description: the description of the database. Specify a name that is easy to remember and identify, such as transaction database, user database, or test database. This field is optional.
View the two added data sources.
Create a task
After you add data sources, perform the following steps to perform full migration, incremental synchronization, or schema migration.
Choose Task Management > Create Task.
Set the source and destination databases.
Select the task running cluster. The task will be scheduled to a server that is bound to the cluster. After CloudCanal Community Edition is deployed, a default running cluster is created. Select Default Cluster in the drop-down list as the task running cluster.
Select the source MySQL instance and the destination OceanBase instance, and then click Test Connection.
Select the source and destination databases for migration, synchronization, or verification to specify the database mapping.
Click Next.
Complete the feature settings.
Select Incremental Synchronization. At the first synchronization, CloudCanal checks the table and performs full synchronization. Afterward, CloudCanal consumes binlogs to synchronize only incremental data.
Task types:
- Full Migration: applies mainly to data migration. You can select this type for full data migration and provisional incremental synchronization.
- Incremental Synchronization: applies to data synchronization. This is the default value. By default, Full Initialization is enabled for this task type. This task type applies to long-term incremental synchronization.
- Data Verification: compares data in the source and destination databases to verify the accuracy of migrated data on a one-off or periodic basis. CloudCanal Community Edition does not support this feature.
- Schema Migration: automatically creates the corresponding database and tables based on the selected database and tables.
- Data Correction: compares the data in the source and destination databases and overrides the inconsistent data in the destination database with that in the source database. CloudCanal Community Edition does not support this feature.
Task Specifications: Use the default specifications, namely the Balanced specifications with 2G memory.
Click Next.
Perform table and action filtering.
Select the table to be synchronized. Make sure that the
UPDATEandDELETEoperations performed on the destination database are consistent with those performed on the source database. In addition, make sure that the tables in the source database have a PRIMARY KEY or UNIQUE KEY constraint.Click Next.
Perform data processing.
Select the columns to be synchronized in the table.
Click Next.
Confirm the task information.
Confirm the task information and then click OK to create the task.
View the task status
After the task is created, schema migration, full migration, and incremental synchronization are automatically performed. The progress bar will advance gradually. Return to the task management page of CloudCanal. Refresh the page and view the real-time task status, which changes from schema migration to data initialization and data synchronization.
More information
For more information about CloudCanal, see the CloudCanal documentation.