You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by James <ol...@yahoo.com> on 2015/02/10 03:44:27 UTC

how to backup repository with all history?

I read there are at least three ways to do backup:
1. hotcopy;2. dump;3. incremental backup;
I am just wondering are them all have the history included? If I restore any of them, I will get everything, including the history or previous revisions,  back?
Thanks,James

RE: Re: how to backup repository with all history?

Posted by "Cooke, Mark" <ma...@siemens.com>.
> -----Original Message-----
> From: Andreas Stieger [mailto:Andreas.Stieger@gmx.de]
> Sent: 10 February 2015 08:25
> 
> Hi,
> 
> > I have few repositories in my svn-root directory.
> > I have put a conf folder at the same level as other repositories. that
> > conf folder contains a authz and a passwd file which are shared by all
> > repositories. By doing this I can setup users and their privilege in
> > one place. But because of this conf folder, I cannot do hotcopy
> > automatically. I am thinking just tar all of them daily.
> 
> In a trivial script, make a loop to execute hotcopy on all repositories,
> usually simply all directories found by dir/ls in the parent, and execute a
> file system copy for your named configuration directory.
> 
> Andreas

Does `hotcopy` include hook scripts these days?

~ mark c


Aw: Re: how to backup repository with all history?

Posted by Andreas Stieger <An...@gmx.de>.
Hi,
 
> I have few repositories in my svn-root directory.
> I have put a conf folder at the same level as other repositories. that
> conf folder contains a authz and a passwd file which are shared by all
> repositories. By doing this I can setup users and their privilege in
> one place. But because of this conf folder, I cannot do hotcopy
> automatically. I am thinking just tar all of them daily. 

In a trivial script, make a loop to execute hotcopy on all repositories, usually simply all directories found by dir/ls in the parent, and execute a file system copy for your named configuration directory.

Andreas

Re: how to backup repository with all history?

Posted by Les Mikesell <le...@gmail.com>.
On Mon, Feb 9, 2015 at 10:25 PM, James <ol...@yahoo.com> wrote:
> I have few repositories in my svn-root directory.
> I have put a conf folder at the same level as other repositories. that conf
> folder contains a authz and a passwd file which are shared by all
> repositories. By doing this I can setup users and their privilege in one
> place. But because of this conf folder, I cannot do hotcopy automatically. I
> am thinking just tar all of them daily.
>
> My purpose of backup is just in case my machine die. So how big the
> difference will be for my tar approach and the hotcopy?

If you are sure that no changes can happen during the tar run, that
should be fine - or rsync to another system might be more efficient.
But with any backup approach you need to understand that you can't
continue to use existing working copies that might have newer
revisions than the restored backup. You would have to check out a
fresh copy, then copy over any new work you want to keep from the old
working copy and commit again.

And yet another alternative if you have another system to hold the
data (and it's not much of a backup if you don't...) would be to
svnsync each repository and rsync your common config.

-- 
   Les Mikesell
     lesmikesell@gmail.com

Re: how to backup repository with all history?

Posted by James <ol...@yahoo.com>.
I have few repositories in my svn-root directory. I have put a conf folder at the same level as other repositories. that conf folder contains a authz and a passwd file which are shared by all repositories. By doing this I can setup users and their privilege in one place. But because of this conf folder, I cannot do hotcopy automatically. I am thinking just tar all of them daily.  

My purpose of backup is just in case my machine die. So how big the difference will be for my tar approach and the hotcopy?
     From: Nico Kadel-Garcia <nk...@gmail.com>
 To: James <ol...@yahoo.com> 
Cc: "users@subversion.apache.org" <us...@subversion.apache.org> 
 Sent: Monday, February 9, 2015 10:54 PM
 Subject: Re: how to backup repository with all history?
   
On Mon, Feb 9, 2015 at 9:44 PM, James <ol...@yahoo.com> wrote:


> I read there are at least three ways to do backup:
>
> 1. hotcopy;
> 2. dump;
> 3. incremental backup;
>
> I am just wondering are them all have the history included? If I restore any
> of them, I will get everything, including the history or previous revisions,
> back?

In theory, yes. In practice..... there are some operations, such as
dumping and reloading with large binaries or sensitive data excluded,
that are designed to *alter* history and clear undesired material This
can cause oddness if you have a linked slave, which is yet another way
to do backup. There are also operations that will, once a history is
corrupted, merely replicate the corrupted history. And remember that
the deprecated Berkeley DB logs from older Subversion environments are
not cross-platrofm compatible, so bringing those to another host can
cause trouble.


  

Re: how to backup repository with all history?

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Mon, Feb 9, 2015 at 9:44 PM, James <ol...@yahoo.com> wrote:
> I read there are at least three ways to do backup:
>
> 1. hotcopy;
> 2. dump;
> 3. incremental backup;
>
> I am just wondering are them all have the history included? If I restore any
> of them, I will get everything, including the history or previous revisions,
> back?

In theory, yes. In practice..... there are some operations, such as
dumping and reloading with large binaries or sensitive data excluded,
that are designed to *alter* history and clear undesired material This
can cause oddness if you have a linked slave, which is yet another way
to do backup. There are also operations that will, once a history is
corrupted, merely replicate the corrupted history. And remember that
the deprecated Berkeley DB logs from older Subversion environments are
not cross-platrofm compatible, so bringing those to another host can
cause trouble.

Re: how to backup repository with all history?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 9, 2015, at 8:44 PM, James wrote:

> I read there are at least three ways to do backup:
> 
> 1. hotcopy;

Yes; the repository produced by "svnadmin hotcopy" is a complete copy of your repository, including all history, scripts and configuration files.

> 2. dump;

Yes, if you do not use the "-r" flag to limit which revisions are dumped, the output produced by "svnadmin dump" includes the history of all revisions which can be saved to a file and later replayed into a new repository by running "svnadmin load", however it does not include any scripts or configuration files; back them up separately.

> 3. incremental backup;

By definition, an incremental backup contains only the changes since your last backup. There is no separate "incremental backup" command in Subversion, but there is an "--incremental" flag to "svnadmin dump" that you can use if that's what you want.

In any backup strategy, you should assure yourself that you can restore a working setup from the backup by periodically attempting to do so.