SVN Mirroring


This article outlines how to configure an SVN repository mirror. All instructions are from the perspective of the mirror, and it is assumed that the repository that you are making a mirror of already exists and is configured properly. I’m also assuming you have a basic idea of how SVN works.

Install SVN

Linux

# yum install subversion

Windows

Create Repository

Linux

# svnadmin create /home/svn/(REPO)

Windows

# svnadmin create C:\svn\(REPO)

Create Hook

Linux

Create /home/svn/(REPO)/hooks/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

Windows

Create an empty file at C:\svn\(REPO)\hooks\pre-revprop-change.bat

Initilize Repository

Linux

# svnsync init svn://localhost/(REPO) svn://(REMOTE_REPO)

Windows

# svnsync init svn://localhost/(REPO) svn://(REMOTE_REPO)

Sync

Linux

# svnsync sync svn://localhost/(REPO)

Windows

# svnsync sync svn://localhost/(REPO)

Fix Lock Issue

If you are getting a “Failed to get lock” error:
# svn propdel svn:sync-lock –revprop -r 0 svn://localhost/

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>