Chris Hoover | 14 Jun 17:49 2012
Picon

How to backup and restore via mongodump tarballs.

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

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
Scott Hernandez | 14 Jun 18:05 2012
Picon

Re: How to backup and restore via mongodump tarballs.

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

On Thu, Jun 14, 2012 at 5:49 PM, Chris Hoover <revoohc@...> wrote:
> 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
>
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@...
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@...
> See also the IRC channel -- freenode.net#mongodb

--

-- 
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user@...
To unsubscribe from this group, send email to
mongodb-user+unsubscribe@...
See also the IRC channel -- freenode.net#mongodb


Gmane