Svnsync - switching source and mirror
From: Bailey, Darragh <dbailey_at_hp.com>
Date: Tue, 2 Feb 2010 17:42:44 +0000
Looking to setup a mirror to a locally hosted svn repo, however it's expected that in the future the role of which repo is the mirror and which is the master will reverse.
Reading up on svnsync, there appears to be some suggestion that something happens with the 'svnsync init' command that is specific to the new mirror. I'm wondering if this will be an issue when changing which repo is the master and which is the mirror?
It's not clear what exactly is set by this initial command. AFAICT it's only the last changed datestamp on rev 0, i.e. the initial create time of the source repository. It doesn't appear to copy the UUID, or provide an option to copy this, although maybe that's just because of the version I'm testing this on (1.4).
What I'm looking to achieve is the following:
Some ASCII diagrams:
Current:
Next step: Setup remote read-only mirror for team 2
Final stage: switch which is master and which is mirror
While there seems to be plenty of documentation on setting up the mirror using svnsync, I haven't seen anything on whether anything special needs to be done to convert the mirror to a proper repo.
Based on what I want to do, below are the steps that I think I need to follow. Would appreciate any pointers to something that I've missed or any gotcha's that I've overlooked.
First stage: setting up the mirror
2) Create a svn repository on the remote system
3) Setup pre-revprop-change and pre-commit scripts to let only svnsync user edit the mirror repo
if [ "$USER" = "svnsync" ]; then exit 0; fi
echo "Only the svnsync user can change revprops" >&2
/var/svn/mirror/hooks/pre-commit
USER=`/usr/local/bin/svnlook author -t "$TXN" "$REPOS"`
echo "This is a mirror repository only, please commit to the master"
4) From the local system init the repository with svnsync
5) Synchronise the repositories
6) Put the local repo into read-only mode temporarily and repeat step 6 (since otherwise it would read-only for many hours)
7) Add post-commit and post-rev-changes to forward and future changes to the master repository to the
/var/svn/master/hooks/post-rev-change
8) Copy the repo UUID from the master to the mirror
Remote system
Switching the role of mirror and master
10) Add scripts to the mirror to forward changes made to the former master repo
/var/svn/mirror/hooks/post-rev-change
11) Remove the changes made to the post-commit and post-rev-change scripts on the original master
12) Remove the tests is pre-revprop-change and pre-commit on the mirror for the user svnsync
Have I covered everything here?
Is there something that "svnsync init" in step 4 does to the mirror repository that will have to be undone before it can be used as a normal repository and also replicated on the original master before it can be used as a read-only mirror?
-- Regards, Darragh Bailey Systems Software Engineer Hewlett Packard Galway Ltd. Postal Address: Hewlett Packard Galway Limited, Ballybrit Business Park, Galway Registered Office: Hewlett Packard Galway Limited, 63-74 Sir John Rogerson's Quay Dublin 2 Registered Number: 361933Received on 2010-02-02 18:43:57 CET |
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.