[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Backup strategies

From: Jack Repenning <jrepenning_at_collab.net>
Date: 2005-01-11 20:37:11 CET

> -----Original Message-----
> From: Karan, Cem (Civ, ARL/CISD) [mailto:CKaran@arl.army.mil]

> > -----Original Message-----
> > From: Ritesh Nadhani [mailto:riteshp@webyog.com]
> > ...
> > Reading the docs the various methods to backup a repository are:
> >
> > 1.) svnadmin dump --incremental
> > 2.) Do a complete backup of the folder? (it is supposed to be
> > unsafe as somebody might be checking at that time)
> > 3.) use hot-backup.py.
> >
> > We are little biased towards the second option as we know
> > that nobody is
> > checking when we are doing a backup.
> > ...
>
> I think I heard/read somewhere that #2 isn't safe to do, but I may be
> remembering incorrectly. Does anyone more knowledgeable know if this is
> safe? #3 seems to do the same thing as #2, but without having to worry
> about corrupting the repository as you're copying. maybe it also
> handles the fact that the copy is somewhere other than the original
> location as well???

#2 is unsafe if there's any slightest chance that anyone is accessing the
repo, even merely for read purposes, during the process. It is not just
checkins that concern you, here: any access at all can cause problems! You
are utterly on your own to guarantee this does not happen. There are, of
course, realistic situations where you have this confidence, and it may be
that you're fine with #2. Just remember: this is your backup you're talking
about! When you need to restore it, you're going to be desperate, and
rushed, and you won't have any options left if, just this one time, someone
happened to sneak in a little "svn ls" just as you were doing the backup.

#3 is critically different from #2, in that it copies the files in an order
that's safely recoverable even if someone accesses the repo during the
backup operation. That's a very important difference! (I'm not clear on
whether that's what was implied by "without corrupting the repo.") If you
make your backup with hot-backup.py, and then use "db_recover -c" (not just
"svnadmin recover," unfortunately; the "-c" addition turns out to be
necessary, and is not yet available through svnadmin), then you're
guaranteed a healthy repo at the end. (The transaction that was going on
while you did the backup might possibly be lost, but a lost transaction here
or there is part of the assumptions of backup and recovery--it's the same
effect as if that person had waited a moment longer to whack "return".)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 11 20:39:31 2005

This is an archived mail posted to the Subversion Users mailing list.