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:
is not the same as
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.
| Categories: Development | Tips&Tricks