How to backup and restore via mongodump tarballs.

3,778 views
Skip to first unread message

Chris Hoover

unread,
Jun 14, 2012, 11:49:13 AM6/14/12
to mongod...@googlegroups.com
Maybe I'm missing something, but it seems that there is no way with mongodump to easily dump the entire database into a tarball.  Is there anyway to do this?  My current solution is rather cludgy and I'd like it to be easier to backup and restore.

I'm doing:

backups:
1.  mongo dump to directory
2.  tar up directory
3.  copy to archive server

restore:
1.  copy from archive server
2.  untar to file system
3.  run mongorestore

Ideally, I'd like it to be:
backups:
1.  mongodump | tar -cf - > backup file
2.  copy to archive server

restores:
1. copy from archive server
2.  tar -xOf <file> | mongorestore


Thanks,

Chris

Scott Hernandez

unread,
Jun 14, 2012, 12:05:25 PM6/14/12
to mongod...@googlegroups.com
You are correct that you can't pipe into a compression program. The
issue is that mongodump just dumps bson files and there is no
delimiter between collections/files.

See this issue: https://jira.mongodb.org/browse/SERVER-5190
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
Reply all
Reply to author
Forward
0 new messages