Navigation

Import Data into Cluster

Data Import Programs

You can bring data from existing MongoDB deployments or JSON/CSV files into Atlas using one of the following:

Program Use Case
Live Migrate feature.

To migrate from a MongoDB replica set into an Atlas cluster.

Important

  • The source MongoDB replica set must be version 3.0 or greater.
  • Live Migrate does not import user/role data.
mongomirror

To migrate from a MongoDB replica set into an Atlas cluster.

mongomirror does not require you to shut down your existing replica set or applications.

Important

  • The source MongoDB replica set must be version 3.0 or greater.
  • mongomirror does not import user/role data.

See the tutorial Migrate with mongomirror.

mongorestore

To seed an Atlas cluster with a BSON dump backup of an existing MongoDB deployment.

Important

mongorestore does not restore system.profile collection data.

See the tutorial Seed with mongorestore.

mongoimport

To load data from a JSON or a CSV file into an Atlas cluster.

See the tutorial Load File with mongoimport.

You can also restore from an Atlas cluster backup data to another Atlas cluster. For information, see Restore a Cluster.

Import Strategies for Common Cluster Configurations

The following table covers the best import strategy for common cluster configurations:

Cluster Configuration Import Strategy
A replica set.

Use Live Migrate.

You must provide the hostname of the primary to the Live Migrate tool.

If the cluster is not running MongoDB 3.0 or above, you must first upgrade it.

You must have access to the primary node’s oplog. If the cluster runs with authentication, you must have credentials that provide read access to the primary and its oplog.

A “single shardsharded cluster in Compose. This is the standard configuration for new MongoDB deployments in Compose.

Use Live Migrate.

You must enable the oplog proxy.

You must specify the hostname and credentials for the oplog proxy when connecting from Live Migrate.

A standalone MongoDB node.

Convert the standalone MongoDB to a single-node replica set and use Live Migrate.

If the MongoDB is not running MongoDB 3.0 or above, you must upgrade it.

If you are running with authentication enabled, you must have credentials that provide read access to the primary and its oplog.

If you cannot convert the standalone to a replica set, use mongodump and mongorestore. See Seed with mongorestore.

A shared multi-tenant cluster, or a cluster where you have no oplog access.

Use mongodump and mongorestore. See Seed with mongorestore.

If you are running with authentication enabled, you must have credentials that provide read access to the primary.

A sharded cluster with multiple shards.

If near-continuous uptime is a requirement, please contact MongoDB. From the Atlas UI, click Support. Fill out a Support ticket, noting your uptime requirements and cluster configuration in the More details text entry.

If some downtime is OK, you may use mongodump and mongorestore. See Seed with mongorestore and Backup Sharded Cluster with Database Dumps.

To migrate data from an M0 (Free Tier) cluster to a paid cluster, see Migrate Data from an M0 (Free Tier) Cluster to a Paid Cluster.