This topic describes how to use OceanBase Migration Service (OMS) Community Edition to migrate data from an ElasticSearch database to OceanBase Database Community Edition.
Background information
OMS Community Edition V4.2.13-CE and later versions support incremental synchronization from an ElasticSearch database to OceanBase Database Community Edition by installing the Translog plugin or using _seq_no pagination. If you have installed the Translog plugin in your ElasticSearch cluster, you can obtain DELETE data. However, you must restart the ElasticSearch cluster and enable the index.soft_deletes.enabled parameter to retain historical operations for Translog tracing. If you have not installed the Translog plugin in your ElasticSearch cluster, you cannot obtain DELETE data.
Plugin location
| Plugin location | Supported versions |
|---|---|
| /home/ds/plugins/elasticsearch/oms-es-ccr-plugin-7x-x.x.x.zip | ElasticSearch V7.x supported versions: V7.6.0, V7.6.1, V7.6.2, V7.7.0, V7.7.1, V7.8.0, V7.8.1, V7.9.0, V7.9.1, V7.9.2, V7.9.3, V7.10.0, V7.10.1, V7.10.2, V7.11.1, V7.11.2, V7.12.0, V7.12.1, V7.13.0, V7.13.1, V7.13.2, V7.13.3, V7.13.4, V7.14.0, V7.14.1, V7.14.2, V7.15.0, V7.15.1, V7.15.2, V7.16.0, V7.16.1, V7.16.2, V7.16.3, V7.17.0, V7.17.1, V7.17.2, V7.17.3, V7.17.4, V7.17.10, V7.17.11, V7.17.12, V7.17.13, V7.17.17, V7.17.20, V7.17.21, V7.17.22, V7.17.23, V7.17.24, V7.17.25, V7.17.26, V7.17.27, V7.17.28, V7.17.29 |
| /home/ds/plugins/elasticsearch/oms-es-ccr-plugin-8x-x.x.x.zip | ElasticSearch V8.x supported versions: V8.0.0, V8.1.0, V8.2.0, V8.3.0, V8.4.0, V8.5.0, V8.6.0, V8.7.0, V8.8.1, V8.9.0, V8.10.0, V8.11.0, V8.11.3, V8.12.0, V8.13.0, V8.14.0, V8.16.0, V8.17.0, V8.18.0, V8.19.0, V8.19.1, V8.19.2, V8.19.3, V8.19.4, V8.19.5, V8.19.6, V8.19.7, V8.19.8, V8.19.9, V8.19.10, V8.19.11 |
Plugin installation
# After installing the plugin, incremental synchronization can obtain DELETE data
bin/elasticsearch-plugin install file:///data/1/soft/oms-es-ccr-plugin-7x-7.6.2.zip
bin/elasticsearch-plugin install file:///data/1/soft/oms-es-ccr-plugin-8x-8.8.1.zip
# View the installed plugins
bin/elasticsearch-plugin list
# The plugin name of OMS is as follows
oms-es-ccr-plugin-7x
oms-es-ccr-plugin-8x
# After the plugin is installed, you need to restart the ElasticSearch server
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 and incremental synchronization DML.
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 migrating databases, tables, and columns with ASCII-compliant names that do not contain special characters (spaces, line breaks, or |"'`()=;/&).
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 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 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, configure the parameters.
Options of Migration Type includes Full Migration and Incremental Synchronization.
Migration Type Description 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. Incremental Synchronization After an incremental synchronization task is created, OMS Community Edition synchronizes the data that has changed in the source database (newly added, modified, or deleted data) to the corresponding tables in the target database.
Incremental Synchronization DMLs includeInsert,Delete, andUpdate. You can select as needed. For more information, see DML Filtering.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.
To view or modify the parameters of the full migration component, click Configuration Details in the upper-right corner of the Full Migration section. To view or modify the parameters of the incremental synchronization component, click Store Configuration Details or Configuration Details of incr Increment in the upper-right corner of the Incremental Synchronization section as needed. For more information about the parameters, see the documentation in the Component parameters module.
Full migration
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 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.
Incremental synchronization
The following parameters are displayed only if you select Incremental Synchronization on the Select Migration Type page.
Parameter Description Concurrency Speed The migration concurrency. Valid values: Stable, Normal, Fast, and Custom. The performance of incremental synchronization varies depending on the migration concurrency. The resources required for an incremental synchronization task vary depending on the migration concurrency. If you select Custom, you can set Read Concurrency, Write Concurrency, and JVM Memory. Incremental Synchronization Start Timestamp - If you have selected Full Migration as the migration type, this parameter is not displayed.
- If you have selected Incremental Synchronization but not Full Migration, specify the data to be migrated after a specific point in time. The default value is the current system time. For more information, see Set the incremental synchronization point in time.
Incremental Record Retention Time The duration that incremental parsed files are cached in OMS Community Edition. A longer retention period results in more disk space occupied by the Store component of OMS Community Edition.
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.
