This is tested using POSIX environment, especially linux mint. No guarantee will work with others. This technique is using mongodump
and mongorestore
commands.
Backup From Atlas
Using Atlas
go to specific folder and dump the db.
mongodump --uri="mongodb+srv://<USERNAME>:<PASSWORD>@<CLUSTER_NAME>.mongodb.net/<DB_NAME>
it will create folder dump
with collection name inside.
Restore To Atlas
within the same folder, run:
mongorestore --uri="mongodb+srv://<USERNAME>:<PASSWORD>@<CLUSTER_NAME>.mongodb.net/<TARGET_DB_NAME>" ./dump/<DB_FOLDER>/
done.
Top comments (0)