Once you have successfully configured SVN you surely need to configure backup, mirror of running repositories.
Mirror can be used as read only repo, thus reducing load from the primary SVN server.
Backup.
svnadmin dump /home/svnroot/Project1/ > /tmp/project1.dump
Restore
svnadmin load < /tmp/project1.dump /home/svnroot/Project1/
Mirror / Proxy SVN.
Assuming you have configured primary server.
On secondary / mirror (192.168.1.2)
create dest repo
svnadmin create /home/svnroot/project
create user (svn.passwd) & set auth (svn.auth) Refer svn users & svn user based rights.
uncomment password-db = passwd in svnserve.conf
adduser in passwd file svnsync = tux (create same user & password on source, not mandatory to use same auth, if you are using diff auth modify svnsync init accordingly .)
Create pre-revprop-change
cd svnrepo/project1/hooks cat pre-revprop-change #!/bin/sh USER="$3" if [ "$USER" = "svnsync" ]; then exit 0; fi echo "Only the svnsync user can change revprops" >&2 exit 1 chmod +x pre-revprop-change
——————–
pre-revprop-change
Because Subversion’s revision properties are not versioned, making modifications to such a property (for example, the svn:log commit message property) will overwrite the previous value of that property forever. Since data can be potentially lost here, Subversion supplies this hook (and its counterpart, post-revprop-change) so that repository administrators can keep records of changes to these items using some external means if they so desire. As a precaution against losing unversioned property data, Subversion clients will not be allowed to remotely modify revision properties at all unless this hook is implemented for your repository.
This hook runs just before such a modification is made to the repository. The repository passes four arguments to this hook: the path to the repository, the revision on which the to-be-modified property exists, the authenticated username of the person making the change, and the name of the property itself.
——————–
Initialize sync
svnsync init --username svnsync --password tux file:///home/svnroot/project1 http://192.168.1.1/svn/repos/project1
Start sync
svnsync sync --username svnsync --password tux file:///home/svnroot/project1 (put this as cronjob for scheduled sync)
Once after successful sync you can check read only repo on mirror server (here 192.168.1.2)
Pingback: RespoStyle for SVN | LinuxReaders