BC Blog

Chase Excellence, Success will Follow

0%

Common MongoDB Commands for Restore and Backup

One-line backup command for MongoDB

1
mongodump --db <dbname>

One-line drop command for MongoDB Database.

1
$ mongo <dbname> --eval "db.dropDatabase()"

Then, we could easily resotre the backup folder that contains both BSON and JSON files.

1
$ mongorestore <folder_name> --db <dbname>

Welcome to my other publishing channels