This topic describes how to use OceanBase Migration Service (OMS) Community Edition to migrate data from a StarRocks database to OceanBase Database.
Limitations
Limitations on operations in the source database
Do not perform DDL operations that modify database or table schemas during full migration. Otherwise, the data migration task may be interrupted.
The supported StarRocks database versions are V2.3.18 and V3.3.15.
Data migration from StarRocks to OceanBase Database Community Edition supports only full migration.
Data source identifiers and user accounts must be globally unique in the OMS system.
OMS Community Edition only supports migrating databases, tables, and column objects with ASCII-compliant names that do not contain special characters (|"'`()=;/& or line breaks).
We recommend that you migrate no more than 1,000 tables in one go to avoid affecting the operation of the data migration task.
Fields of the ARRAY or MAP type require a user-defined function (UDF) to convert JSON strings. OMS automatically creates the required UDFs (with names starting with omsudf_) based on the field type. These UDFs will not be automatically deleted after the data migration is complete.
In the StarRocks external table scenario, the following limitations apply:
Migration of data of the BINARY, VARBINARY, and STRUCT types is not supported.
The specific number of records inserted into the target table cannot be obtained.
OMS creates an external table named
omsext_+ source table name prefixin the source StarRocks database, and this external table will not be automatically deleted after the data migration is complete.
Data type mapping
| StarRocks database | OceanBase Database Community Edition |
|---|---|
| BIGINT | BIGINT |
| BOOLEAN | BOOLEAN |
| CHAR | CHAR |
| DATE | DATE |
| DATETIME | DATETIME |
| DECIMAL | DECIMAL |
| DOUBLE | DOUBLE |
| FLOAT | FLOAT |
| INT | INT |
| SMALLINT | SMALLINT |
| STRING | VARCHAR |
| TINYINT | TINYINT |
| VARCHAR | VARCHAR |
| BINARY/VARBINARY | VARBINARY |
| LARGEINT | BIGINT UNSIGNED Maximum value: 18446744073709551615. If the value stored in the StarRocks database exceeds this limit, it will be stored as 18446744073709551615 in OceanBase Database Community Edition. |
| JSON | JSON |
| MAP | JSON |
| STRUCT | JSON |
| ARRAY | JSON |
| BITMAP | STRING Use the bitmap_to_string function to read data from the StarRocks database, convert it to a string, and write it to OceanBase Database Community Edition. |
| HLL | BIGINT Use the hll_cardinality function to read data from the StarRocks database, convert it to an integer, and write it to OceanBase Database Community Edition. |
Create a data migration task.
Log in to the OMS console.
In the left-side navigation pane, click Data Migration.
On the Migration Tasks 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, numbers, and letters. The name cannot contain spaces and must be less than 64 characters in length. Tag Click the field and select the target 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 StarRocks 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 StarRocks 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 created, OMS Community Edition migrates the existing data in the source database tables to the corresponding tables in the target database.
Click Next. On the Select Migration Objects page, select the migration objects and the migration scope.
You can select migration objects by using Specify Objects or Match Rules. This topic describes how to select migration objects by using Specify Objects. For more information about how to configure match rules, see Configure match rules for migration objects.
Notice
The name of a table to be migrated, as well as the names of columns in the table, must not contain Chinese characters.
If the name of a database or table contains the characters "$$", an error occurs when you create a data migration task.
In the Select Migration Objects section, select Specify Objects.
In the Specify Migration Scope section, select the objects to be migrated from the Source Object(s) list.
Click > to add the selected objects to the Target Object(s) list.
When you migrate data from a StarRocks database to OceanBase Database Community Edition, OMS Community Edition allows you to import objects, rename objects, and remove one or more migration objects.
Operation Steps Import objects - In the Specify Migration Scope section, click Import Objects in the upper-right corner of the right-side list.
- In the dialog box that appears, click OK.
Notice:
Importing objects will overwrite the previous object selection. Proceed with caution. - In the Import Migration Objects dialog box, import the objects to be migrated.
You can rename databases and tables by importing a CSV file. For more information, see Download and import the settings of migration objects. - Click Validate.
- After the validity check is passed, click OK.
Rename objects OMS Community Edition allows you to rename migration objects. For more information, see Rename databases and tables. 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.
If you need 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 Component parameters.
Notice
On the Select Migration Type page, select Full Migration to display the following parameters.
Parameter Description Concurrency Speed The migration concurrency. Valid values: Stable, Normal, Fast, and Custom. The performance of full migration varies depending on the migration concurrency. The resources required for a full migration task vary depending on the migration concurrency. If you select Custom, you can set Read Concurrency, Write Concurrency, and JVM Memory. 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.
Write Method Valid values: SQL (data is written to a table by using INSERTorREPLACE) and Direct Load (data is written to a table by using direct load). At present, direct load is not supported for vector data.- 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 to perform a precheck on the data migration task.
In the Precheck section, OMS Community Edition checks whether the network connection to the database meets the requirements. You can start the data migration task only after all checks are passed. If an error is returned during the precheck:
You can resolve the error and then run the precheck again until the precheck succeeds.
Click Skip in the Actions column of the failed precheck item. In the dialog box that prompts the consequences of the operation, click OK.
Click Start Task. If you do not need to start the task now, click Save to go 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 in a data migration task during the migration. For more information, see View and modify migration objects. After the data migration task is started, it executes based on the migration type you selected. For more information, see the "View migration details" section in View details of a data migration task.