I was recently asked to move our subversion repository from one server to another. Both of the servers were in remote locations and all I had was ssh access.
Its actually not that hard to do however there was a limited amount of information on the subject. Please note you will need ssh access to both servers with the proper read/write permisions.
Step One: Back up your old repository
This is done with the svnadmin command. To be honest you should already have back ups of you repository using this method. I will elaborate on that later. Anyway if you do not have a backup this is how to make one.
svnadmin dump /path/to/repository > reponame.dmp
Next Step: Create the new Repository
This is simply the same as creating a new project on your svn server
svnadmin create /path/to/repository
Next Step: Transfer the old Repository
You can do this any way you want to. I choose scp since I am the most familier with it.
scp reponame.dmp root@remote-server:/path/to/new/repo
Last Step: Import your old repository into the new one
svnadmin load /path/to/repository < reponame.dmp
Its that simple. Be warned that the file can be quite large if you have lots of revisions. My .dmp file was about 900MB so it took a hour or so to transfer. Obviously if you have physical access to the servers this could be a five min job but I did not.
You may want to force subversion to use the same UUID for the new repository as the old repository, if so just add
--force-uuid to your
svnadmin load command.
Next I will share my backup solution I am writing to keep daily .dmp files of our repository in case of fatal disaster.