mongorestore. Those are straightforward tools that let you export and import Mongo data (Mongo people did their job very well there, much less hassle than with a traditional RDBMS where you have to backup the database, deal with the transaction log, bla bla bla). All is well when working with local machines. Remotely, you need to go the extra step of figuring out the database address, username and password. This gets messier with Heroku and eventually starts smelling bad.
I want to do this the “Rails Way” by invoking a single rake command that imports and exports Mongo data in any of my environments
So he wrote a Rake task for backing up MongoDB to Amazon S3.
Original title and link: A Rake Task for Backing Up a MongoDB Database (NoSQL databases © myNoSQL)