Restore a Collection from a MMS Backup

So something happened and you want to restore just a single collection in your Mongo database. MMS by MongoDB (formerly 10gen) themselves can create full backups of your databases and replica sets, however when it comes time to actually restoring it can get a bit tricky. You probably want to avoid restoring the entire database and seeding it to your other replica set members.

Once you made the restore request on MMS, you'll either have the individual database files or the archive transferred to the target destination host of your choice. First you'll need to do a mongodump of the new backup directory (not the local database) by:

mongodump --dbpath [PATH] --db [DB_NAME] --collection [COLLECTION_NAME]

Then you can restore it to the target as follows:

mongorestore --host [IP/HOSTNAME] --port [PORT] --db [DB_NAME] --username [USER] --password [PASS] --collection [COLLECTION_NAME] dump/db/col.bson

Note that this method can be lengthy and resource intensive depending on how large your collection or database is. You may want to ensure you have proper indices in place or explore other means of backup/restore options for your situation.