There are a few ways you can make a backup with Mongo. The most simple is to take a copy of the database files and put them somewhere safe. This is made easier if you’ve put each database into its own directory. However, this is a pretty naive method as you will have to stop the server and restart it. You also will be taking a full backup. That said, this method does have its uses in a scenario where you are messing around with a secondary but that’s beyond the scope of this short post.
Its possible to extend this a little by using mongodump against the file system. The tool will lock the files so the database cannot be in use at the time but it at least provides a binary export of the data.
For a developer scenario, its more likely that we’ll be using mongodump, mongorestore, mongoimport and mongoexport against our running database. We may need some data from a co-worker or from the live system or we may be the provider of some data to another member of our team.