Take the 2-minute tour ×

I've been planning a migration of a Subversion repository from a Linux server to a Windows server. I've outlined the steps to the migration as such:

  1. Create a dump of the repository
  2. Transfer the dump file to the destination Windows server
  3. Upload the repository in the new subversion server
  4. Change all references to old repository to new repository

After some frustration I finally reached step 4 but have come to a dilemma...I'm not sure how to change all the references. I've seen that relocate can be used but I've also heard that switch should be used if the structure changes...this is project for work so I NEED to make sure the proper command is used on the last step to avoid fallout.

The current file structure looks like so:

svn://svn@servername/Source/Program Name/bin/Release

The new file structure is dictated by VisualSVN Server and looks like so:

https://ServerName.domain.local/svn/RepositoryName/Source/Program Name/bin/Release

Will relocate work for this or am I going in the wrong direction?

share|improve this question
add comment

3 Answers

Yes, svn switch --relocate command should work. But please note that you have to relocate root of your working copy.

share|improve this answer
What do you mean by relocating the root of the working copy? –  Cipher Mar 21 '12 at 0:22
add comment

Previous answerers don't read docs

>svn help switch

  2. The '--relocate' option is deprecated. This syntax is equivalent to
     'svn relocate FROM-PREFIX TO-PREFIX [PATH]'.

You must

  • to use svn relocate (because you rewrite more than prefix)
  • Use second form of relocate syntax relocate TO-URL [PATH], see also example in svn help relocate
  2. TO-URL is the (complete) new repository URL to use for PATH.



  svn relocate http://www.example.com/repo/project \


in example old references svn://svn.example.com/repo/project are replaced by http://www.example.com/repo/project

share|improve this answer
NOTE: The --relocate option is deprecated since Subversion version 1.7. In Subversion 1.6 you'd use svn switch --relocate https://oldserver.com/reponame https://newserver.com/reponame. The 1.6 docs say "The --relocate option causes svn switch to do something different: it updates your working copy to point to the same repository directory, only at a different URL (typically because an administrator has moved the repository to another server, or to another URL on the same server)." –  eyecatchUp Jan 16 at 12:59
add comment

Use svn switch --relocate I just did it on a repo and it works likes magic. If you are using TortoiseSVN, use the "Relocate" command, not the "Switch" command.

share|improve this answer
I have TortoiseSVN but I have to use these commands within a batch file so that I can scale it to the entire network. –  Cipher Mar 21 '12 at 0:22
add comment

Your Answer


