How to move a Subversion repository

Here is a simple technique to move a Subversion repository from one machine to another.

First, back up the repository with svn dump:

svnadmin dump /path/to/repos > repos.dump

Copy the repos.dump file to the new machine.

Log into the new machine and create the repository as your svn user.

svnadmin create /path/to/new/repos

Restore the data with svnadmin load:

svnadmin load /path/to/new/repos < repos.dump

IMPORTANT: Set the permissions. If you don't do this, it's unlikely you will be able to use the repository as you would like.

chown -R svn:svnusers /path/to/new/repos ; chmod -R g+w /path/to/new/repos/db/

Test the new repository by commiting a change. You should not get any permission errors.


Tecnical Bits: A Simple Way to Backup and Restore a Subversion Repository (but note the missing permission step)

ArchWiki: Subversion backup and restore (includes stuff you don't need if Subversion is already installed)