Last active
August 30, 2020 03:54
-
-
Save sheldon-small/355e13b6a9d5321c21c91dee1f50cf0c to your computer and use it in GitHub Desktop.
commands to migrate from mongoDB community to atlas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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