How to Migrate a Subversion Repository

October 29th, 2010

Moving a repository from one server to another is not something one typically does, so it’s good to know the (few) steps involved to make migration a smooth transition.

On the source computer:

svnadmin dump /path/to/repository > repository-name.dump
tar zcf repository-name.tgz repository-name.dump
scp repository-name.tgz hostname:/path/to/new/repository

On the destination computer:

cd /path/to/new/repository
svnadmin create repository-name
tar zxf repository-name.tgz
svnadmin load repository-name < repository-name.dump

Once complete, disable the old repository before testing, to ensure all linkage to the new repository is updated.