Migrating Data and Applications

Oracle Database API for MongoDB supports two recommended approaches for migrating existing MongoDB workloads. Use the offline workflow with mongodump and mongorestore when a brief service interruption is acceptable. Use Oracle GoldenGate when the application must remain available throughout the migration.

Offline Migration using mongodump and mongorestore

MongoDB Tools includes the mongodump and mongorestore utilities that move data between databases. These tools deliver a straightforward method to migrate complete databases and collections, including JSON indexes and metadata. Because these tools perform a fast, binary-level export and import (BSON format), they are well suited for migrating full fidelity copies of MongoDB databases.

Example:

# Run mongodump on the existing MongoDB instance
mongodump --uri "mongodb://<src_user>:<src_pwd>@<src_host>:27017/payroll..." \
  --archive=/tmp/mongodump/payroll.archive.gz \
  --gzip \
  --numParallelCollections=4

# Run mongorestore with the connection string to the Oracle API for MongoDB
mongorestore \
  --uri "mongodb://<target_user>:<target_pwd>@<target_host>:27017/payroll..." \
  --archive=/tmp/mongodump/payroll.archive.gz \
  --gzip \
  --numParallelCollections=4

This example calls mongodump to export the payroll database to the file payroll.archive.gz. It then calls mongorestore to load the archive into the target database. This method preserves every collection and index in the payroll database. When you run mongorestore, connect as an administrative user so that the target schema, such as payroll, can be created automatically if needed.

See also:

Online Migration using Oracle GoldenGate

Oracle GoldenGate is a fully managed replication technology designed for real-time, continuous data movement between heterogeneous databases. Unlike bulk-load methods that require downtime or read-only states during migration, GoldenGate uses Extract and Replicat processes to capture committed transactions from the source, write them to trail files, and apply them to the target with minimal latency.

This architecture keeps the source and target databases synchronized for days or even weeks, enabling delayed cutovers during planned maintenance windows. By reserving the final switchover for a controlled time, GoldenGate supports business continuity for mission-critical, 24×7 systems where even short outages are unacceptable.

Because of its transactional consistency, heterogeneous platform support, and robust conflict management, GoldenGate is often the preferred solution for enterprises that require high-availability migrations with near-zero downtime and reduced operational risk.

See: