MongoDB Complete Backup And Restore Command With Atlas
Ijash

Ijash @ijash

About: Well, here I am. What are your other two wishes?

Location:
Longitude‎: ‎-97.8220 Latitude‎: ‎37.7510. pick me up
Joined:
Jan 24, 2019

MongoDB Complete Backup And Restore Command With Atlas

Publish Date: Dec 2 '21
1 0

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>
Enter fullscreen mode Exit fullscreen mode

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>/
Enter fullscreen mode Exit fullscreen mode

done.

Comments 0 total

    Add comment