This topic describes how to use OceanBase Migration Service (OMS) Community Edition to migrate data from an ElasticSearch database to OceanBase Database Community Edition.
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.
At present, data migration tasks from an ElasticSearch database to OceanBase Database Community Edition support only full migration.
The supported versions of Elasticsearch are V7.x and V8.x.
Data source identifiers and user accounts must be globally unique in OMS.
OMS Community Edition supports only migrating databases, tables, and column objects with ASCII-compliant names that do not contain special characters (|"'`()=;/& and line breaks).
We recommend that you migrate no more than 1,000 tables at a time to avoid impacting the data migration task.
Data type mappings
| ElasticSearch database | OceanBase Database Community Edition |
|---|---|
| string | varchar |
| text | varchar |
| keyword | varchar |
| short | integer |
| integer | integer |
| long | bigint |
| float | float |
| double | double |
| half_float | float |
| scaled_float | float |
| date | timestamp |
| boolean | tinyint |
| binary | binary |
| array | array,varchar |
| object | text |
| nested | text |
| geo_point | point |
| geo_shape | geometry |
| ip | varchar |
| dense_vector | 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 Migration Tasks page, click New 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 must not contain spaces and must not exceed 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 a tag. For more information, see Manage data migration tasks by using tags. Source If you have created an ElasticSearch data source, select it from the drop-down list. If you have not created one, 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 ElasticSearch data source. Target If you have created an OceanBase Database Community Edition data source, select it from the drop-down list. If you have not created one, 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 object and migration scope.
You can select the migration object from Specify Objects and Match Rules. This topic describes how to select the migration object from Specify Objects. For more information about how to configure matching rules, see Configure matching rules for a migration object.
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 migration object from the Source Object(s) list.
Click > to add the migration object to the Target Object(s) list.
When you migrate data from an ElasticSearch 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 previously selected objects. Proceed with caution. - In the Import Migration Objects dialog box, import the objects to be migrated.
You can also rename databases and tables by importing CSV files. For more information, see Download and import the settings of a migration object. - Click Validate.
- After the objects pass the validation, click OK.
Rename objects OMS Community Edition allows you to rename migration objects. For more information, see Rename databases and tables. Remove/Remove All OMS Community Edition allows you to remove one or more objects temporarily selected for migration to the target database during data mapping. - Remove a single migration object
Hover the pointer over the target object in the right-side list of the Specify Migration Scope section and click Remove to remove the migration object. - Remove all migration objects
In the right-side list of the Specify Migration Scope section, click Remove All in the upper-right corner. In the dialog box that appears, click OK to remove all migration objects.
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 the documentation in 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 Valid values: Stable, Normal, Fast, and Custom. The performance of a full migration task varies depending on the migration objects. The resources required for a full migration task also vary depending on the migration objects. If you select Custom, you can set Read Concurrency, Write Concurrency, and JVM Memory based on the actual situation. 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 a data migration task only after all the check items pass. If an error is returned during the precheck:
You can troubleshoot and fix the error, and then perform 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 to start the data migration 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.