We have just got a new (virtual) server at work to use as a continuous integration server which I plan to also use as a source control / subversion server. This means I need to move all existing repositories from their current server to the new one. What I didn’t want to happen was to need to delete and recreate all working copies in order to use the new repositories.
All my searching seemed to point to a command line approach; creating a dump of the repository on the old server, loading that dump on the new server and then using svn switch –relocate oldurl newurl (or the switch command from TortoiseSVN)- I tried this but kept getting an error saying:
https://oldserver:8443/svn/MyRepository
is not the same as
https://newserver:8443/svn/MyRepository
So I did a bit more googling around the ‘is not the same repository’ error, checked to make sure that the new repository was using the same uuid as the old one, which it was (use svnlook uuid path/to/repository). Then, just as I was about to give up for the night and go home I found the answer and it was much easier than anything I’d tried before.
Moving repositories between servers
First you need to move the repository to the new server. I am using VisualSVN Server which makes this very easy; right click on the Repositories root node then go to All Tasks then Import Existing Repository…
This brings up a dialogue for you to browse to the original repository.
When you do this it copies the entire repository over (complete with its uuid) and includes all history, every commit and the ability to roll back to any previous version!
Update clients and working copies
Next you need to update your working copies; right click on the WC, go to TortoiseSVN menu select Relocate and simply enter your new repository address.
This updates all references in your WC to the new repository and from that point on you will be updating from and committing to the new repository.
Easy eh! Now I’ve just got to move another 30 or so repositories and I can turn off the old repository server.
53c9a787-5962-4ed8-89cd-c95eff8b2b90|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags: subversion, tortoisesvn, repositories |
Categories: Development | Tips&Tricks