OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Migration Service

V4.2.15Community Edition
  • OMS Documentation
  • What's New
  • OMS Community Edition Introduction
    • What is OMS Community Edition?
    • Terms
    • OMS Community Edition HA
    • Architecture
      • Overview
      • Hierarchical functional system
      • Basic components
    • Limitations
  • Quick Start
    • Data migration process
    • Data synchronization process
  • Deploy OMS Community Edition
    • Deployment modes
    • System and network requirements
    • Memory and disk requirements
    • Prepare the environment
    • Deploy by using Docker
      • Single-node deployment
      • Single-region multi-node deployment
      • Multi-region multi-node deployment
      • Scale out
      • Check the deployment
      • Deploy a time-series database (Optional)
    • Deploy by using k8s
      • Single-node deployment
      • Single-region multi-node deployment
      • Multi-region multi-node deployment
      • Scale out
    • Integrate the OIDC protocol into OMS Community Edition to implement SSO
  • OMS Community Edition console
    • Log in to the console of OMS Community Edition
    • Overview
    • User center
      • Configure user information
      • Change your logon password
      • Log off
  • Data migration
    • Overview
    • Migrate data from a MySQL database to OceanBase Database Community Edition
    • Migrate data from HBase to OBKV
    • Migrate incremental data from OBKV to HBase
    • Migrate data from a Milvus database to OceanBase Database Community Edition
    • Migrate data from a Redis database to an OBKV-Redis database
    • Migrate data between tenants of OceanBase Database Community Edition
    • Migrate data in active-active disaster recovery scenarios
    • Migrate data from a TiDB database to OceanBase Database Community Edition
    • Migrate data from a PostgreSQL database to OceanBase Database Community Edition
    • Migrate data from Hive to OceanBase Database Community Edition
    • Migrate data from an ElasticSearch database to OceanBase Database Community Edition
    • Migrate data from OceanBase Database Community Edition to an ElasticSearch database
    • Migrate data from a MongoDB database to OceanBase Database Community Edition
    • Migrate data from a StarRocks database to OceanBase Database Community Edition
    • Migrate data from a Qdrant database to OceanBase Database Community Edition
    • Migrate data from a Doris database to OceanBase Database Community Edition
    • Migrate data from a ClickHouse database to OceanBase Database Community Edition
    • Manage data migration tasks
      • View details of a data migration task
      • Change the name of a data migration task
      • View and modify migration objects
      • Manage computing platforms
      • Use tags to manage data migration tasks
      • Perform batch operations on data migration tasks
      • Download and import settings of migration objects
      • Start and pause a data migration task
      • Release and delete a data migration task
    • Features
      • DML filtering
      • DDL synchronization
      • Configure matching rules for migration objects
      • Wildcard rules
      • Rename a database table
      • Use SQL conditions to filter data
      • Create and update a heartbeat table
      • Schema migration mechanisms
      • Schema migration operations
      • Set an incremental synchronization timestamp
      • Direct load
    • Supported DDL operations in incremental migration and limits
      • DDL synchronization from MySQL database to OceanBase Community Edition
        • Overview of DDL synchronization from a MySQL database to a MySQL-compatible tenant of OceanBase Database
        • CREATE TABLE
          • Create a table
          • Create a column
          • Create an index or a constraint
          • Create partitions
        • Data type conversion
        • ALTER TABLE
          • Modify a table
          • Operations on columns
          • Operations on constraints and indexes
          • Operations on partitions
        • TRUNCATE TABLE
        • RENAME TABLE
        • DROP TABLE
        • CREATE INDEX
        • DROP INDEX
        • DDL incompatibilities between MySQL database and OceanBase Community Edition
          • Overview
          • Incompatibilities of the CREATE TABLE statement
            • Incompatibilities of CREATE TABLE
            • Column types that are supported to create indexes or constraints
          • Incompatibilities of the ALTER TABLE statement
            • Incompatibilities of ALTER TABLE
            • Change the type of a constrained column
            • Change the type of an unconstrained column
            • Change the length of a constrained column
            • Change the length of an unconstrained column
            • Delete a constrained column
          • Incompatibilities of DROP INDEX operations
      • Supported DDL operations in incremental migration between MySQL-compatible tenants of OceanBase Database
      • Synchronize DDL operations from a PostgreSQL database to OceanBase Database
  • Data synchronization
    • Data synchronization overview
    • Create a task to synchronize data from OceanBase Database Community Edition to a Kafka instance
    • Create a task to synchronize data from OceanBase Database Community Edition to a RocketMQ instance
    • Manage data synchronization tasks
      • View details of a data synchronization task
      • Change the name of a data synchronization task
      • View and modify synchronization objects
      • Use tags to manage data synchronization tasks
      • Perform batch operations on data synchronization tasks
      • Download and import the settings of synchronization objects
      • Start and pause a data synchronization task
      • Release and delete a data synchronization task
    • Features
      • DML filtering
      • DDL synchronization
      • Configure matching rules for synchronization objects
      • Rename a topic
      • Use SQL conditions to filter data
      • Column filtering
      • Data format description
  • Create and manage data sources
    • Create data sources
      • Create an OceanBase-CE data source
      • Create a MySQL data source
      • Create a TiDB data source
      • Create a Kafka data source
      • Create a RocketMQ data source
      • Create a PostgreSQL data source
      • Create an HBase data source
      • Create a Qdrant data source
      • Create a Milvus data source
      • Create a Redis data source
      • Create a Hive data source
      • Create an ElasticSearch data source
      • Create a MongoDB data source
      • Create a StarRocks data source
      • Create a Doris data source
      • Create a ClickHouse data source
    • Manage data sources
      • View data source information
      • Copy a data source
      • Edit a data source
      • Delete a data source
      • Cache system views
    • Create a database user
    • User privileges
    • Enable binlogs for the MySQL database
  • OPS & Monitoring
    • O&M overview
    • Go to the overview page
    • Server
      • View server information
      • Update the quota
      • View server logs
      • Delete a server
    • Components
      • Store
        • Create a Store component
        • View details of a Store component
        • Update the configurations of a Store component
        • Start and pause a Store component
        • Delete a Store component
      • Incr-Sync
        • View details of an Incr-Sync component
        • Start and pause an Incr-Sync component
        • Migrate an Incr-Sync component
        • Update the configurations of an Incr-Sync component
        • Batch O&M
        • Delete an Incr-Sync component
      • Full-Import
        • View details of a Full-Import component
        • Pause a Full-Import component
        • Rerun and resume a Full-Import component
        • Update the configurations of a Full-Import component
        • Delete a Full-Import component
      • Full-Verification
        • View details of a Full-Verification component
        • Pause a Full-Verification component
        • Rerun and resume a Full-Verification component
        • Update the configurations of a Full-Verification component
        • Delete a Full-Verification component
      • Component parameters
        • Coordinator
        • Condition
        • Source Plugin
          • Overview
          • StoreSource
          • DataFlowSource
          • LogProxySource
          • KafkaSource (TiDB)
          • HBaseSource
          • HiveSource
          • ElasticSearchSource
          • MongoDBSource
        • Sink Plugin
          • Overview
          • JDBC-Sink
          • KafkaSink
          • DatahubSink
          • RocketMQSink
          • HBaseSink
          • HiveSink
        • Store parameters
          • Parameters of a MySQL store
          • Parameters of an OceanBase store
          • ElasticSearch Store
          • MongoDB Store
        • Parameters of the CM component
        • Parameters of the Supervisor component
        • Parameters of the Full-Verification component
    • O&M Task
      • View O&M tasks
      • Skip a task or subtask
      • Retry a task or subtask
  • System management
    • Permission Management
      • Overview
      • Manage users
      • Manage departments
    • Alert center
      • View task alerts
      • View system alerts
      • Manage alert settings
    • Associate with OCP clusters
    • System parameters
      • Modify system parameters
      • Modify HA configurations
    • SSO management
      • Overview
      • Create an SSO integration
      • Enable or disable an SSO integration
      • Edit an SSO integration
      • Delete an SSO integration
  • OMS Community Edition O&M
    • Manage OMS services
    • OMS logs
    • Component O&M
      • O&M operations for the Supervisor component
      • CLI-based O&M for the Connector component
      • O&M operations for the Store component
    • Component tuning
      • Full/Incremental data migration performance optimization
    • Set throttling
  • Reference Guide
    • API Reference
      • Overview
      • CreateProject
      • StartProject
      • StopProject
      • ResumeProject
      • ReleaseProject
      • DeleteProject
      • ListProjects
      • DescribeProject
      • DescribeProjectSteps
      • DescribeProjectStepMetric
      • DescribeProjectProgress
      • DescribeProjectComponents
      • ListProjectFullVerifyResult
      • StartProjectsByLabel
      • StopProjectsByLabel
      • CreateMysqlDataSource
      • CreateMySQLMasterSlaveDataSource
      • CreateOceanBaseDataSource
      • CreateKafkaDataSource
      • Create a TiDB data source
      • ListDataSource
      • DeleteDataSource
      • CreateLabel
      • ListAllLabels
      • ListFullVerifyInconsistenciesResult
      • ListFullVerifyCorrectionsResult
      • UpdateStore
      • UpdateFullImport
      • UpdateIncrSync
      • UpdateFullVerification
      • UploadFile
      • SubmitPreCheck
      • GetPreCheckResult
      • RetryPreCheck
    • OMS error codes
    • Alert Reference
      • oms_host_down
      • oms_host_down_migrate_resource
      • oms_host_threshold
      • oms_migration_failed
      • oms_migration_delay
      • oms_sync_failed
      • oms_sync_status_inconsistent
      • oms_sync_delay
    • Telemetry parameters
    • Create a trigger
  • Upgrade Guide
    • Overview
    • Single-node upgrade
    • Multi-node upgrade
    • Hot upgrade of OMS Community Edition
    • Upgrade the CDC library
    • FAQ
  • FAQ
    • OMS Community Edition Troubleshooting Guide
    • General O&M
      • How do I modify the resource quotas of an OMS container?
      • Clear files in the Store component
      • How do I troubleshoot the OMS server down issue?
      • Deploy InfluxDB for OMS
      • Increase the disk space of the OMS host
    • Task diagnostics
      • What do I do when a store does not have data of the timestamp requested by the downstream?
      • What do I do when OceanBase Store failed to access an OceanBase cluster through RPC?
    • OPS & monitoring
      • What are the alert rules?
    • Data synchronization
      • FAQ about synchronization to a message queue
        • What are the strategies for ensuring the message order in incremental data synchronization to Kafka
      • Performance troubleshooting and tuning for data synchronization from OceanBase Community Edition to Kafka
    • Data migration
      • Full migration
        • How do I query the ID of a checker?
        • How do I query log files of the Checker component of OMS?
        • How do I query the verification result files of the Checker component of OMS?
        • Garbled characters in the Latin1 character set
        • What do I do if the target table does not exist?
        • What can I do when the full migration failed due to LOB fields?
        • What do I do if garbled characters cannot be written into OceanBase Database V3.1.2?
      • Incremental synchronization
        • How do I skip DDL statements?
        • How do I update allowlists and blocklists?
        • What are the application scope and limits of ETL?
    • Logon and password
      • What do I do if my logon password is locked?
    • Installation and deployment
      • How do I upgrade Store?
      • What do I do when the "Failed to fetch" error is reported?
      • Change port numbers for components
      • Switching between the primary and standby OMS MetaDBs

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Migration Service
  3. V4.2.15

Migrate data from a MongoDB database to OceanBase Database Community Edition

Last Updated:2026-10-30 02:29:01

Limitations
Data type mappings
Procedure
References

This topic describes how to use OceanBase Migration Service (OMS) Community Edition to migrate data from a MongoDB database to OceanBase Database Community Edition.

Limitations

  • Limitations on 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.

  • Data migration tasks from a MongoDB database to OceanBase Database Community Edition currently support schema migration, full migration, incremental synchronization, full verification, and reverse incremental migration.

  • Currently supported MongoDB database versions are V3.x, V4.0.0, V4.4.6, V5.0.0, V6.0.0, V7.0.22, V8.0.15, and V8.0.29.

  • 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 in ASCII 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 affecting the operation of the data migration task.

  • Oplog must be enabled for MongoDB incremental migration.

  • The MongoDB data source user must have read permission on the local database (for example, must have the read role applied to the local database) so that the incremental component can read from the local.oplog.rs file.

    Note

    Starting from version 7.0, MongoDB has stricter access controls for the local database. Even if a user has roles such as root, explicit read permission on local must be granted; otherwise, a "not authorized on local" error will be returned.

Data type mappings

MongoDB Database
OceanBase Database Community Edition
double double
string string
object text
array text
array
binary data binary
objectId varchar
boolean tinyint
date datetime
regular expression varchar
JavaScript text
timestamp timestamp
integer bigint
decimal decimal

Procedure

  1. Create a data migration task.

    1. Log in to the OMS Community Edition console.

    2. In the left-side navigation pane, click Data Migration.

    3. On the Migration Tasks page, click Create Task in the upper-right corner.

  2. On the Select Source and Target page, configure the parameters.

    Parameter
    Description
    Migration 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.
    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 a MongoDB 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 a MongoDB 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.
  3. Click Next.

  4. On the Select Migration Type page, configure the parameters.

    The Migration Type includes Schema Migration, Full Migration, Incremental Synchronization, and Reverse Increment.

    Migration Type
    Description
    Schema Migration After a schema migration task starts, OMS Community Edition migrates the data object definitions (tables, indexes, etc.) from the source database to the destination database.
    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. In this case, only the SQL for the table structure is obtained during schema migration. Execution begins after you modify the table structure.
    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 includes Insert, Delete, and Update. You can choose as needed. For more information, see Filter DML operations.
    Full Verification After full migration is completed, 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 Manually collect statistics.
    • If you selected Incremental Synchronization and not all DML operations are selected for the DML Synchronization option, OMS Community Edition does not support full data verification in this scenario.
    Reverse Increment After a reverse increment task starts, it can continuously flow back the changed data generated in the destination database after the business switchover to the source database.
  5. Click Next. On the Select Migration Objects page, select the migration objects and scope.

    You can select migration objects through two methods: 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.

    Note

    • 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.

    1. In the Select Migration Objects section, select Specify Objects.

    2. In the Specify Migration Scope section, select the objects to be migrated from the Source Object(s) list.

    3. Click > to add it to the Target Object(s) list.

    When migrating data from a MongoDB database to OceanBase Database Community Edition, OMS Community Edition supports importing objects via text, renaming object names, and removing single or all migration objects.

    Operation
    Step
    Import Objects
    1. In the right-side list of the Specify Migration Scope section, click Import Objects in the upper-right corner.
    2. In the dialog box, click OK.
      Note:
      The import will overwrite previous operation selections. Proceed with caution.
    3. 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.
    4. Click Validate.
    5. After passing the legality validation, click OK.
    Rename OMS Community Edition supports renaming migration object names. For more information, see Rename a database or table.
    Settings You can select columns to exclude in the Settings > View Column section so that they are not migrated later.
    Remove/Remove All OMS Community Edition allows you to remove one or more objects temporarily selected for migration to the target during data mapping.
    • Remove a single migration object
      In the right-side list of the Specify Migration Scope section, hover the mouse over the target object and click the displayed 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, click OK to remove all migration objects.
  6. Configure global field mappings.

    At the bottom of the Select Migration Objects page, OMS Community Edition provides the Global Configuration Field Mapping - Forward section for configuring the field mapping relationship between the source and target.

    • Write Mongo _id to a column in the target table: This option is selected by default. If you clear this option, the _id field is not synchronized. It must be retained when you select reverse incremental migration.

    • Mongo _id column name: Specifies the column name in the target table that stores the Mongo _id. The default value is id.

    • Document written as JSON in one column: If you select this option, the target table contains only the _id column and the document column (the entire document is stored in JSON format). After you select this option, field mappings and table-level renaming do not take effect, and the _id field is retained by force.

    • Convert camelCase column names at the source to underscore case and write them to the target: If you select this option, camelCase column names at the source (such as userName) are automatically converted to underscore case names (such as user_name) before being written to the target.

    • Custom field mapping: Click Add Mapping to manually configure the mapping relationship between source field names and target field names. This applies to scenarios where the field names at the source and target are inconsistent.

  7. 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 or reverse incremental migration 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 documentation in the Component parameters module.

    • Full Migration

      Note

      The following parameters are displayed only if you have selected Full Migration on the Select Migration Type page.

      Parameter
      Description
      Concurrency Speed Valid values: Stable, Normal, Fast, and Custom. Different full migration speeds result in 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 the table using INSERT or REPLACE) and Direct Load (writes via direct load). Currently, writing vector-type data via direct load is not supported.
    • Incremental Synchronization

      The following parameters are displayed only if you have selected Incremental Synchronization on the Select Migration Type page.

      Parameter
      Description
      Concurrency 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 based on your actual situation.
      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.

      Parameter
      Description
      Concurrency 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 based on your actual situation.
    • Reverse Incremental

      The following parameters are displayed only if Reverse Increment is selected on the Select Migration Type page.

      Parameter
      Description
      Concurrency Speed Includes Stable, Normal, Fast, and Custom. The performance of reverse incremental varies, as does the resources required for a reverse incremental task. When you select Custom, you can set Read Concurrency, Write Concurrency, and JVM Memory based on your actual situation.
  8. 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 start 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.

  9. 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 according to the selected migration type. For details, see the content in the "View migration details" section of View details of a data migration task.

References

  • Create a MongoDB data source

  • Create an OceanBase-CE data source

  • Component parameters

  • View and modify migration objects

  • View details of a data migration task

Previous topic

Migrate data from OceanBase Database Community Edition to an ElasticSearch database
Last

Next topic

Migrate data from a StarRocks database to OceanBase Database Community Edition
Next
on this page
Limitations
Data type mappings
Procedure
References