Skip to content

Instantly share code, notes, and snippets.

@sheldon-small
Last active August 30, 2020 03:54
Show Gist options
  • Select an option

  • Save sheldon-small/355e13b6a9d5321c21c91dee1f50cf0c to your computer and use it in GitHub Desktop.

Select an option

Save sheldon-small/355e13b6a9d5321c21c91dee1f50cf0c to your computer and use it in GitHub Desktop.
commands to migrate from mongoDB community to atlas
Mongodump - mongod single instance
mongodump --host localhost --port 27017 -u <user> -p <password> -d <databaseName> --out <outputDir>
Mongodump - mlabs
mongodump -h ds012345.mlab.com:56789 -d dbname -u dbuser -p dbpassword -o dumpdir
Mongodump - MongoDB Atlas
mongodump --uri mongodb+srv://<username>:<password>@<primary_cluster_name>.mongodb.net/<database_name> -o <output_path>
MongoRestore to MongoDB Atlas 4.2^
mongorestore --uri="mongodb+srv://<username>:<password>@<replicaset_name>.mongodb.net/?authSource=admin" "<db_dump_dir>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment