Wors World
All About Wor

Relocating SVN Repository

While Intelligent Decisioning Ltd are a Microsoft Gold Certified partner, we still make use of Subversion (Svn) to host our code repository.  I know that Team Foundation Server is a great piece of s/w but it’s big, complicated and requires all developers to have Team Foundation server functionality and some of the devs we work with don’t.
 
I’ve recently moved our Svn repository from an internally hosted service to an external hoster.  They’re cheap at $60 a year and it takes away a certain amount of admin from me and my fellow ID colleagues.
 
To move the actual code repository requires use of the command line utility svnadmin.  The command I used was svnadmin dump /path/to/repos > myrepos.dump which creates a single file that Svn can import to populate a repository.  BTW, make sure you type the redirect pipe ">" otherwise your server will dump the binary contents of the repository to the screen resulting in a crazed beeping session that you just can’t stop :-).
 
Once I had the "dump" file, I imported them into my newly created hosted repository which went without a hitch and switched off our old repository.
 
All done?  Well no, not quite.
 
When you attempt to carry out any Svn repository functionality (update,commit, compare etc.) you’ll find that your TortoiseSvn (the Svn repository client) is still pointing at the old repository – good job I stopped the old repository otherwise I may have been blissfuly unaware that I hadn’t actually connected to the new.
 
To point TortoiseSvn to the new repository you need to use either the TortoiseSvn relocate menu option or use the svn command line.
 
I tried the menu option first and was presented with a message telling me that "The repository at ‘https://ourhoster/id-live/project’ has uuid ‘f
881a828-44c3-41be-a4ae-c8af87ade81f’, but the WC has ‘68393c81-089e-e149-a2b0-4f7cc15966ed’".
 
A bit of Googling told me that I needed to use the command line and issue an svn command "svn switch https://ourhoster/id-live/project" – I tried and it failed with the message as above.  There is also a –force command option which I tried "svn switch –force https://ourhoster/id-live/project" – no joy.
 
Further Googling led me to try "svn sw –relocate https://ourinternalserver:8443/svn/project https://ourhoster/id-live/project" which also failed – I then edited this to be "svn sw –relocate https://ourinternalserver/svn/project https://ourhoster/id-live/project" – success.
 
 
 
Advertisement

No Responses to “Relocating SVN Repository”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: