How To: Move an SVN Repo

Example Details

Hotcopy or rsync the repository to the new location

original location: /usr/local/svn/miller
new location: /u1/svn_spill/miller

With svnhotcopy

svnadmin hotcopy /usr/local/svn/miller /u1/svn_spill/miller

With rsync

Ensure you have blocked access via apache to the repository that you are moving

### Use below config for moving repositories ###
<Location /svn/miller>
  Order Allow,Deny
  Deny from all
</Location>

Now run the rsync command

rsync -ak /usr/local/svn/miller /u1/svn_spill/miller

Verify each repo is the same size

cd /usr/local/svn/miller
du -s
cd /u1/svn_spill/miller
du -s

If each was the same size, remove original repo

rm -R /usr/local/svn/miller

Symbolic Linking

Create symbolic link (in old repo location) to the new repo location

ln -s /u1/svn_spill/miller /usr/local/svn/miller

Permissions

set proper permissions

chown -R svn:svn /u1/svn_spill/miller
chmod -R g+w /u1/svn_spill/miller

Verify

Browse your repo to make sure it works

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.