Backup a mongo database

27th Mar, 2012 | mongodb

Mongodb  - awesome!

As few general admin tasks like backing up a full database:

# Creates a directory called 'dump' in the current directory containing the specified collection

mongodump -d mydb -c mycollection

and restoring from a backup:

mongorestore --drop --db mydb --collection mycollection /home/myhome/mongo.bson