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

Re: Creating and Verifying a Reliable backup

From: Michael Schwager <mschwage_at_gmail.com>
Date: Wed, 1 Jun 2016 11:18:33 -0500

Yessity-yes-yes-yessss!!!!! svnadmin freeze- I missed that one! That's
something I can really sink my teeth into! Awesome, thanks!

My intention is to perform the following:
* shut down httpd
Then, for each repoX:
* svnadmin verify /home/svn/hotcopy/repoX. If error, warn and exit.
* svnadmin hotcopy into /home/svn/hotcopy/repoX. If error, warn and exit.
* svnadmin verify /home/svn/hotcopy/repoX. If error, warn and exit.
* svnadmin freeze /path/to/repoX -- rsync -av /path/to/repoX
/home/svn/rsync/repoX.
* rsync -c -n -av /path/to/repoX /home/svn/rsync/repoX. (perform a checksum
compare) If error, warn and exit.

I had considered svnadmin dump, but according to the Wisdom on Serverfault,
"[svnadmin dump] also fails to backup things like the repository scripts
and a few other things..."
(
http://serverfault.com/questions/540214/is-it-necessary-to-do-an-svnadmin-dump-to-backup-subversion
)

"One other thing to watch is svnadmin dump doesn't backup locks and hook
scripts."
http://serverfault.com/questions/52252/best-way-to-do-subversion-backups?rq=1

...I've always presumed this meant that the hotcopy did back up locks and
hook scripts...

On Wed, Jun 1, 2016 at 10:51 AM, Pavel Lyalyakin <
pavel.lyalyakin_at_visualsvn.com> wrote:

> Hello Michael,
>
> On Wed, Jun 1, 2016 at 5:58 PM, Michael Schwager <mschwage_at_gmail.com>
> wrote:
> > Hello,
> > We are very paranoid about our Subversion repo, notwithstanding the fact
> > that the previous sysadmin didn't back it up. But that's another story.
> Now
> > I'm here at my job, I've inherited the repo admin duties, and I want to
> back
> > it up reliably. If we lose it, we're all out of work.
> >
> > My question is: How do I back it up reliably, and verify it so that I can
> > deliver a 100% recovery guarantee to my boss? I have Subversion 1.8.4 on
> a
> > CentOS 6.3 server, and Tortoise SVN 1.8.11 on Windows 7 clients.
>
> Don't forget about `svnadmin verify`[1]. It makes sense to run it
> right now if you've never ran it. ;)
>
> And if you want to deliver recovery guarantee close to 100%, consider
> `svnadmin dump`[2] in addition to hotcopy.
>
> > I am thinking to do both an svn hotcopy to one directory, and an rsync to
> > another. The svn hotcopy will give me a backup that I'm pretty sure is
> > reliable (see Notes below). Assuming httpd is down and I can guarantee
> that
> > I am the only person who will be logged into the SVN server, can I expect
> > with 99.9% surety that the svn repos are quiescent?
>
> I'm not sure that I understand what you mean by "quiescent" here.
> What's your concern?
>
> So you are planning to make a hotcopy and then transfer this hotcopy
> using rsync to another machine, right?
>
> * It's safe to run `svnadmin hotcopy` on a live repository.
>
> * And if you'd have to use `rsync` on a *live* repository, run
> `svnadmin freeze`[3] to prevent concurrent commits to the repo while
> `rsync` is running.
>
> If httpd is disabled and you are the only user logged on, this means that
> your repositories should be untouched by any other processes at this
> moment. Unless you have some indexing services that touch the repos
> (and it is generally recommended to exclude repos from indexing).
>
> > Notes:
> >
> > We're a little worried about svn hotcopy; we ran into a bug that came
> about
> > under 1.8 when working with older repos; the hotcopy exits with the
> > following error:
> >
> > svnadmin: E200002: Serialized hash missing terminator
>
> It seems to be a bug #4554[4] that has been fixed in Subversion 1.9.
> `svnadmin hotcopy` could fail on a repository with older FSFS format.
>
> > I have compiled subversion-1.9.4 on the server under
> /opt/subversion-1.9.4.
> > If I run that version of svn hotcopy, it appears to work and svnverify
> exits
> > successfully. But if I look at all the files under both the original and
> the
> > hotcopy on one of our repos, I find that a file is missing:
> > repos2/db/rev-prop-atomics.shm . That's probably ok, but still- how do we
> > know the latest hotcopy, and hotcopies of the future, are and will remain
> > 100% bug-free?
>
> Use `svnadmin verify` and consider using `svnadmin dump` in addition
> to hotcopies. Make sure that your Subversion server is on the latest
> patch update too.
>
> [1]: http://svnbook.red-bean.com/en/1.8/svn.ref.svnadmin.c.verify.html
> [2]: http://svnbook.red-bean.com/en/1.8/svn.ref.svnadmin.c.dump.html
> [3]: http://svnbook.red-bean.com/en/1.8/svn.ref.svnadmin.c.freeze.html
> [4]: https://issues.apache.org/jira/browse/SVN-4554
>
> --
> With best regards,
> Pavel Lyalyakin
> VisualSVN Team
>

-- 
-Mike Schwager
Received on 2016-06-01 18:18:45 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.