This topic describes how to use OceanBase Migration Service (OMS) Community Edition to migrate data from a ClickHouse database to OceanBase Database Community Edition.
Limitations
Limitations on the source database
Do not perform DDL operations for schema changes on the source database during full migration. Otherwise, the data migration task may be interrupted.
At present, only full migration is supported for data migration tasks from a ClickHouse database to OceanBase Database Community Edition.
At present, OMS Community Edition supports ClickHouse database V21.1.9.41, V22.x, V23.x, V24.x, V25.x, and V26.x.
Data source identifiers and user accounts must be globally unique in OMS Community Edition.
OMS Community Edition supports only migrating databases, tables, and columns with ASCII-compliant names that do not contain special characters (including line breaks, spaces, and |"'`()=;/&).
Considerations
We recommend that you migrate no more than 1,000 tables in one migration task. Otherwise, the data migration task may be affected.
By default, OMS Community Edition slices data based on the primary key of a ClickHouse database. However, the primary key of a ClickHouse database is not unique. Therefore, duplicate data may be generated when you resume a suspended data migration task.
In the external table mode, OMS Community Edition creates remote databases of OceanBase Database Community Edition named
omsext_xxxin the ClickHouse database. After the data migration is completed, OMS Community Edition does not automatically delete the remote databases. You need to delete them manually.
Data type mapping
| ClickHouse Database | OceanBase Database Community Edition |
|---|---|
| Int8 | TINYINT |
| Int16 | SMALLINT |
| Int32 | INT |
| Int64 | BIGINT |
| Int128 | BIGINT |
| Int256 | BIGINT |
| Float32 | FLOAT |
| Float64 | DOUBLE |
| BFloat16 | FLOAT |
| Decimal | DECIMAL |
| Boolean | TINYINT |
| String | VARCHAR |
| FixedString | VARCHAR |
| Date | DATE |
| Date32 | DATE |
| Time | TIME |
| Time64 | TIME |
| DateTime | DATETIME |
| DateTime64 | DATETIME |
| Enum | VARCHAR |
| UUID | VARCHAR |
| IPv4 | VARCHAR |
| IPv6 | VARCHAR |
| Array | JSON |
| Tuple | VARCHAR |
| Map | VARCHAR |
| Point | POINT |
| LineString | LINESTRING |
| MultiLineString | MULTILINESTRING |
| Polygo | POLYGON |
| MultiPolygon | MULTIPOLYGON |
| Geometry | GEOMETRY |
| Dynamic | VARCHAR |
| JSON | JSON |
| QBit | VECTOR |
Procedure
Create a data migration task.
Log in to the OMS Community Edition console.
In the left-side navigation pane, click Data Migration.
On the Data Migration page, click Create Task in the upper-right corner.
On the Select Source and Target page, configure the parameters.
Parameter Description Migration Task Name We recommend that you use a combination of Chinese characters, digits, and letters. The name cannot contain spaces and must be no longer than 64 characters. Tags Click the text box and select a tag from the drop-down list. You can also click Manage Tags to create, modify, or delete tags. For more information, see Manage data migration tasks by using tags. Source If you have created a ClickHouse data source, select it from the drop-down list. If not, click New Data Source in the drop-down list and create a data source in the dialog box that appears. For more information, see Create a ClickHouse data source. Target If you have created an OceanBase Database Community Edition data source, select it from the drop-down list. If not, click New Data Source in the drop-down list and create a data source in the dialog box that appears. For more information, see Create an OceanBase Database Community Edition data source. Click Next.
On the Select Migration Type page, select Full Migration.
After a full migration task is started, OMS Community Edition migrates the existing data in the source database to the corresponding tables in the target database.
Click Next. On the Select Migration Objects page, select the migration object and migration scope.
You can select the migration object by using the Specify Objects and Match Rules options. This topic describes how to select the migration object by using the Specify Objects option. For more information about how to configure the matching rules, see Configure matching rules for migration objects.
Notice
The name of the table to be migrated and the names of the columns in the table cannot contain Chinese characters.
If the database name or table name contains the "$$" character, the data migration task cannot be created.
In the Select Migration Objects section, select Specify Objects.
In the Specify Migration Scope section, select the migration objects from the Source Object(s) list.
Click > to add the migration objects to the Target Object(s) list.
When you migrate data from a ClickHouse database to OceanBase Database Community Edition, OMS Community Edition allows you to import objects by using text, rename objects, and remove one or all migration objects.
Operation Description Import objects - In the list on the right of the Specify Migration Scope section, click Import Objects in the upper-right corner.
- In the dialog box that appears, click OK.
Notice
This operation will overwrite previous selections. Proceed with caution. - In the Import Objects dialog box, import the objects to be migrated.
You can import CSV files to rename databases/tables and set row filtering conditions. For more information, see Download and import the settings of migration objects. - Click Validate.
- After the validation succeeds, click OK.
Rename objects OMS Community Edition allows you to rename migration objects. For more information, see Rename a database table. Remove one or all objects OMS Community Edition allows you to remove a single object or all objects to be migrated to the target database during data mapping. - To remove a single migration object:
In the list on the right of the Specify Migration Scope section, move the pointer over the target object and click Remove. - To remove all migration objects:
In the list on the right of the Specify Migration Scope section, click Remove All in the upper-right corner. In the dialog box that appears, click OK.
Click Next. On the Migration Type page, configure the parameters.
To view or modify the parameters of the full migration component, click Configuration Details in the upper-right corner of the Full Migration section. For more information about the parameters, see the Component parameters module.
Notice
The following parameters are displayed only if you select Full Migration on the Select Migration Type page.
Parameter Description Concurrency Speed Valid values: Stable, Normal, Fast, and Custom. The amount of resources to be consumed by a full migration task varies based on the migration performance. If you select Custom, you can set Read Concurrency, Write Concurrency, and JVM Memory as needed. Processing Strategy When Records Exist in Target Object Valid values: Ignore and Stop Migration. - If you select Ignore, when the data to be inserted conflicts with the existing data of a target table, OMS Community Edition retains the existing data and records the conflict data.
Notice
If you select Ignore, data is pulled in IN mode for full verification. In this case, the scenario where the target contains more data than the source cannot be verified, and the verification efficiency will be decreased.
- If you select Stop Migration and a target table contains data, an error is returned during full migration, indicating that the migration is not allowed. In this case, you must clear the data in the target table before you can continue with the migration.
Notice
After an error is returned, if you click Resume in the dialog box, OMS Community Edition ignores this error and continues to migrate data. Proceed with caution.
Writing Method Valid values: SQL (specifies to write data to tables by using INSERTorREPLACE) and Direct Load (specifies to write data through direct load). At present, you cannot write vector data by using direct load.- If you select Ignore, when the data to be inserted conflicts with the existing data of a target table, OMS Community Edition retains the existing data and records the conflict data.
Click Precheck. The system performs a precheck on the data migration task.
In the Precheck step, OMS Community Edition checks whether the network connection between the databases meets the requirements. You can start a data migration task only after all precheck tasks are completed. If an error is returned during the precheck:
You can troubleshoot and resolve the issue, and then perform the precheck again until the precheck is successful.
You can also click Skip in the Actions column of the error item. A dialog box pops up to prompt you of the impact of skipping the operation. After you confirm that you want to skip the operation, click OK.
Click Start Task. If you do not want to start the task now, click Save. The system jumps to the details page of the data migration task. You can manually start the task as needed.
OMS Community Edition allows you to modify the migration objects during the execution of a data migration task. For more information, see View and modify migration objects. After a data migration task is initiated, the system executes the migration task based on the selected migration type. For more information, see the "View migration details" section in View details of a data migration task.
