There is a warning on the mongodb site about using mongoexport/
mongoimport:
Neither JSON nor TSV/CSV can represent all data types. Please be
careful not to lose or change data (types) when using this. For full
fidelity please use mongodump.
Not sure what that error message means, sorry. You might ask in the
MongoDB google group - 10gen is good about helping users with issues:
http://groups.google.com/group/mongodb-user
Also, I should have mentioned before that there's a guide to
mongorestore and the other MongoDB import/export
I use a mongoexport
mongoexport -h [host]:[port] -d [database] -u [user] -p [password] -c
[collection] -o [path, e.g. ~/tmp/mongoexport/export.json]
And a mongoimport
mongoimport -h [host]:[port] -d [database] -u [user] -p [password] -c
[collection] --file [file, e.g.
And the answer is:
To restore the dump to your local instance of Mongo, make sure you're
in the original directory (the one with subdirectory 'dump') and type
mongorestore
I was trying too hard, I guess. : )
Hemal's suggestion of mongoexport makes a nice readable JSON file for
one collection
Am I right in assuming that Heroku bundles don't include MongoHQ data?
Do db:pull or taps work with MongoHQ?
If not, what are our options for backup and restore for MongoHQ
databases?
I'm sure MongoHQ has backups in case their disks crash but I need my
own backups in case I or a user destroys
Use the mongodump utility from the command line. It comes with
mongodb, and can be pointed at whatever remote database you like.
For example, try a ruby script that looks something like:
host = 'flame.mongohq.com:27000'
db = 'ginnys-database'
user = 'ginny'
pass = 'password'
`mongodump