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 through two methods: installing the Translog plugin and using _seq_no pagination queries. If you have installed the Translog plugin in your ElasticSearch cluster, you can retrieve DELETE data. However, you must restart the ElasticSearch cluster and enable index.soft_deletes.enabled to retain historical operations for Translog tracking. If the Translog plugin is not installed in the ElasticSearch cluster, DELETE data cannot be retrieved.
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, and V7.17.29 |
| /home/ds/plugins/elasticsearch/oms-es-ccr-plugin-8x-x.x.x.zip | Supported versions of ElasticSearch V8.x: 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.7.1, 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, and V8.19.11 |
| /home/ds/plugins/elasticsearch/oms-es-ccr-plugin-9x-x.x.x.zip | ElasticSearch V9.x supported versions: V9.4.3, V9.4.2, V9.4.1, V9.4.0, V9.3.3, V9.3.2, V9.3.1, V9.3.0, V9.2.8, V9.2.7, V9.2.6, V9.2.5, V9.2.4, V9.2.3, V9.2.2, V9.2.1, V9.2.0, V9.1.9, V9.1.8, V9.1.7, V9.1.6, V9.1.5, V9.1.4, V9.1.3, V9.1.2, V9.1.1, V9.1.10, V9.1.0, V9.0.8, V9.0.7, V9.0.6, V9.0.5, V9.0.4, V9.0.3, V9.0.2, V9.0.1, and V9.0.0 |
Plugin installation method
# After the plugin is installed, incremental synchronization can retrieve 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
bin/elasticsearch-plugin install file:///data/1/soft/oms-es-ccr-plugin-9x-9.4.3.zip
# View Installed Plugins
bin/elasticsearch-plugin list
# The plugin names of OMS are as follows:
oms-es-ccr-plugin-7x
oms-es-ccr-plugin-8x
oms-es-ccr-plugin-9x
# After the plugin is installed, you need to restart the ElasticSearch server.
Limitations
Limitations on the source database
Do not perform DDL operations that modify database or table schemas during schema migration or full migration. Otherwise, the data migration task may be interrupted.
Currently, data migration tasks from an ElasticSearch database to OceanBase Database Community Edition support schema migration, full migration, full verification, and incremental synchronization.
Currently supported Elasticsearch database versions are V7.x, V8.x, and V9.x.
Data source identifiers and user accounts must be globally unique within the OMS system.
OMS Community Edition only supports migrating objects whose database, table, and column names are ASCII-compliant and do not contain special characters (including line breaks, spaces, and |"'`()=;/&).
It is recommended that you do not migrate more than 1,000 tables at a time to avoid impacting the operation of 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 |
| geo_point (array) | point |
| compressed_byte_vector | vector |
| sparse_vector | sparse_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.
ParameterDescriptionMigration Task Name It is recommended to use a combination of Chinese characters, numbers, and letters. The name cannot contain spaces and must not exceed 64 characters in length. Tag Click the text box and select a 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 an ElasticSearch data source, select it from the drop-down list. If not, click New Data Source in the drop-down list to create one in the dialog box on the right. For parameter details, see Create an ElasticSearch data source. Destination 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 to create one in the dialog box on the right. For parameter details, see Create an OceanBase-CE data source. Click Next.
On the Select Migration Type page, configure the parameters.
Migration Type includes Schema Migration, Full Migration, Full Verification, and Incremental Synchronization.
Migration TypeDescriptionSchema Migration After a schema migration task starts, OMS Community Edition migrates the data object definitions (such as tables, indexes, constraints, comments, and views) from the source database to the destination database and automatically filters out temporary tables.
Manual Table Schema Adjustment Required: OMS Community Edition supports user-defined table structures. Select this option if you need to manually adjust the table structure. The schema migration will only retrieve the SQL for the table structure and start execution after you make the modifications.Full Migration After a full migration task starts, OMS Community Edition migrates the existing data from the source database tables to the corresponding tables in the destination database. Incremental Synchronization After an incremental synchronization task starts, OMS Community Edition synchronizes the changed data (inserts, modifications, or deletions) from the source database to the corresponding tables in the destination database.
The DML Synchronization option of Incremental Synchronization includesINSERT,DELETE, andUPDATE. You can choose the appropriate option based on your requirements. For more information, see DML filtering.Full Verification After full migration is completed and incremental data is synchronized to the destination and is roughly caught up with the source, OMS Community Edition automatically initiates a full data verification task for the data tables configured in the source and destination databases. - If you select Full Verification, we recommend that you collect statistics from OceanBase Database Community Edition on both the source and destination before full verification starts. For more information, see Collect statistics manually.
- If you selected Incremental Synchronization and not all DML options are selected for DML Synchronization, OMS Community Edition does not support full data verification in this scenario.
Click Next. On the Select Migration Objects page, select the migration objects and scope.
You can select migration objects through two approaches: Specify Objects and Match Rules. This topic describes how to select migration objects using the Specify Objects method. For details on configuring match rules, see Configure match rules for migration objects.
Notice
The names of tables to be migrated and the column names within them must not contain Chinese characters.
If the database name or table name contains the character "$$", it will affect the creation of the data migration task.
In the Select Migration Objects section, select Specify Objects.
In the Specify Migration Scope section, select the objects you want to migrate from the Source Object(s) list.
Click > to add them to the Target Object(s) list.
When migrating data from an ElasticSearch database to OceanBase Database Community Edition, OMS Community Edition supports importing objects via text, renaming object names, and removing one or all migration objects.
OperationStepImport Objects - In the list on the right side of the Specify Migration Scope section, click Import Objects in the upper-right corner.
- In the dialog box, click OK.
Note:
The import will overwrite previous operation selections. 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 migration object configurations. - Click Validate.
- After passing the legality validation, click OK.
Rename OMS Community Edition supports renaming migration objects. For more information, see Rename a database or table. Remove/Remove All OMS Community Edition supports removing one or more temporarily selected objects to the target during data mapping. - Remove a single migration object
In the list on the right side of the Specify Migration Scope section, hover the mouse over the target object and click the displayed Remove to remove that migration object. - Remove all migration objects
In the list on the right side of the Specify Migration Scope section, click Remove All in the upper-right corner. In the dialog box, click OK to remove all migration objects.
Configure global field mappings.
When migrating data from an ElasticSearch database to OceanBase Database Community Edition, OMS Community Edition supports configuring global field mappings.
ParameterDescriptionES Unique Key Column Name Specifies the unique key field name for ElasticSearch documents. The default is id.Split Object/Nested If selected, nested fields of the object or nested type will be split into separate columns for migration; if not selected, they will be migrated as a whole. Convert Source CamelCase Columns to Underscores Before Writing to Target If selected, source camelCase named columns (such as userName) will be automatically converted to underscore named columns (such asuser_name) before being written to the target.Custom Field Mapping Supports manually adding field mapping rules to map source field names to target field names. Click Add Mapping and enter the corresponding field names in the Source Field Name and Target Field Name input boxes. Click Next. On the Migration Type page, configure the parameters.
To view or modify the parameters for the full migration component, click Configuration Details in the upper-right corner of the Full Migration section. To view or modify the parameters for the incremental synchronization component, click Store Configuration Details in the upper-right corner of the Incremental Synchronization section or Configuration Details of incr Increment as needed. For parameter descriptions, see the Component parameters section.
Full Migration
Note
The following parameters are displayed only if you have selected Full Migration on the Select Migration Type page.
ParameterDescriptionConcurrency Speed Valid values: Stable, Normal, Fast, and Custom. Different full migration modes have different performances and resource requirements. When you select Custom, you can set Read Concurrency, Write Concurrency, and JVM Memory based on your actual situation. Processing Strategy When Target Object Has Records Valid values: Ignore and Stop Migration: - If you select Ignore, when data exists in the target table object and conflicts with the data to be written, OMS Community Edition logs the conflicting data and retains the original data unchanged.
Note
If you select Ignore, full verification will pull data in IN mode, which cannot verify scenarios where the target has data not present in the source, and verification performance will be degraded to some extent.
- If you select Stop Migration, when data exists in the target table object, full migration will report an error indicating that migration is not allowed. Please handle the data at the target before continuing the migration.
Note
If you click Resume after an error occurs, OMS Community Edition will ignore this configuration option and continue migrating table data. Proceed with caution.
Write Method Valid values: SQL (writes to tables using INSERTorREPLACE) and Direct Load (writes via direct load). Currently, writing vector-type data via direct load is not supported.- If you select Ignore, when data exists in the target table object and conflicts with the data to be written, OMS Community Edition logs the conflicting data and retains the original data unchanged.
Incremental Synchronization
The following parameters are displayed only if you have selected Incremental Synchronization on the Select Migration Type page.
ParameterDescriptionConcurrency Speed Includes Stable, Normal, Fast, and Custom. The performance and required resources for incremental synchronization vary with the speed. When you select Custom, you can set Read Concurrency, Write Concurrency, and JVM Memory as needed. Incremental Synchronization Start Timestamp - If Full Migration was selected as the migration type, this parameter is not displayed.
- If Full Migration was not selected but Incremental Synchronization was selected, specify a point in time after which data should be migrated. The default is the current system time. For details, see Set an incremental synchronization timestamp.
Incremental Record Retention Time The duration for which incremental parsed files are cached in OMS Community Edition. A longer configured retention time requires more disk space for the OMS Community Edition Store component. Full Verification
The following parameters are displayed only if Full Verification is selected on the Select Migration Type page.
ParameterDescriptionConcurrency Speed Includes Stable, Normal, Fast, and Custom. Resource configuration for the Full-Verification component limits resource consumption during the full verification phase of a task. When you select Custom, you can set Read Concurrency, Write Concurrency, and JVM Memory as needed. Incremental Record Retention Time The duration for which incremental parsed files are cached in OMS. A longer configuration requires more disk space.
Click Precheck to have the system perform a precheck on the data migration task.
During the Precheck step, OMS Community Edition checks whether the database's network connection meets requirements. The data migration task can only be started after all checks pass. If the precheck reports an error:
You can troubleshoot and resolve the issue, then re-execute the precheck until it succeeds.
You can also click Skip in the Actions column for the erroneous precheck item. A dialog box appears, explaining the specific impact of skipping this operation. After confirming it is okay to skip, click OK in the dialog box.
Click Start Task. If you do not need to start the task immediately, click Save to go to the data migration task details page, where you can start it manually later.
OMS Community Edition supports modifying migration objects during the execution of a data migration task. For details, see View and modify migration objects. After a data migration task is started, it is executed sequentially based on the selected migration type. For details, see the "View migration details" section in View details of a data migration task.