Automate Everything: Ruby, Linux and other hints, tips and tricks.

How to migrate a Subversion repository from one server to another

Now I got a new server I had to migrate my old Subversion repository from the old server to the new one. Thanks to Subversion it was a cake easy task:

First, we have to dump our old repository.

ssh old-server.com
svnadmin dump svn/my-project > my-project.dump
exit

Then, we transfer the dump from one server to the other:

cd /tmp
rsync -Praz old-server.com:my-project.dump .
rsync -Praz my-project.dump new-server.com:~

We are now ready to load the dump into the new repository:

ssh new-server.com
mkdir svn
svnadmin create svn/my-project
svnadmin load svn/my-project < my-project.dump
exit

Finally, we update our local copy of the code:

mv my-project my-project.old
svn co svn+ssh://new-server.com/home/your-user-name/svn/my-project/trunk my-project

And you are ready to code!

You can follow any responses to this entry through the RSS 2.0 feed.