Use svnsync to mirror a CodeResort repository

The scanario that is covered by this How-To:

You want to make a backup mirror of a CodeResort repository named 'myproject' on a local machine or server - syncing the full repository with all history (and not just a checkout of current state).

Here is how:

  1. Make sure your user has full permissions to the CodeResort project. Typically member of the @owner group, but it can also be explicitly configured in the 'Subversion' administration page.
  1. Make a new empty repository locally using your favorite Subversion client:
    $> svnadmin create /tmp/myproject-mirror
  1. To allow revision property changes, your local repository needs to have a pre-revprop-change hook enabled. This is technically a script that can do all kinds of interesting things, and as long as it exists without raising errors (non-zero return code) the change will go through. Well just make an empty script that will obviously execute without issues. Remember to mark the script as an executable:
    $> echo '#!/bin/sh' > /tmp/myproject-mirror/hooks/pre-revprop-change
    $> chmod +x /tmp/myproject-mirror/hooks/pre-revprop-change

For Windows, note that the empty pre-revprop-change file must be named pre-revprop-change.bat or pre-revprop-change.exe to execute and it can be a completely empty file.

  1. Now it is time to make the local project aware of the remote repository it should mirror. This should set up the correct local properties:
    $> svnsync init file:///tmp/myproject-mirror https://www.coderesort.com/svn/myproject
  1. Ready? Time to do initial sync (this can be time-consuming depending on project size):
    $> svnsync sync file:///tmp/myproject-mirror

The svnsync sync command can be executed at any later time, and it will fetch all new revisions from the CodeResort project.