2015/09/20: Mirroring svn repositories
Mirroring an svn repository is quite simple.
- If the machine has direct read access to the repository,
e.g., because the machine is usually online, then
the tool to use is svnsync.
To start the process, call svnsync init once. To keep
the repository up to date, call svnsync sync each time
the mirror has to be updated. However, there are some things to
keep in mind.
- svnsync init does not create a repository. Instead,
it expects an existing to be provided. Moreover, this
repository has to allow such operations:
the hooks/pre-revprop-change hook has to be
executable and return 0 whenever such operations are
legitimate.
- svnsync init does not fetch any commits. So, to
actually copy the remote repository, it is necessary to
call svnsync sync afterwards.
- If the machine can only receive files (e.g., via
uucp or by carrying disks around), but otherwise is offline,
then it is best to first create a mirror on an online
machine (as just described) and there create
"dumps". These can be generated with svnadmin
dump and a version range can be specified (note: both, the
first and the last version specified in the range, will be
part of the dump). Dumps can be applied with svnadmin
load. For the initial replication, it is usually faster
to create a tar ball.
Of course, the best way to get an overview over the whole process is
to write a small
shell script which I did as well.