SVN: Relocating your checkout

My company has been doing a lot of cleaning house lately and one of the much-needed fixups has been to set up a new server to host our SVN repository. As a result we have to re-point lots of checkouts at the new server. It’s a very simple process using either of two commands. The first is svn switch –relocate, the second is simply svn relocate.  [note that svn switch –relocate is deprecated in 1.7! Use svn relocate going forward!]

Usage is simple, but it’s important to get the URLs correct!

svn switch --relocate http://old.server.url/trunk http://new.server.url/trunk

This is the 'new' 1.7 way:
svn relocate http://old.server.url/trunk http://new.server.url/trunk

It’s also worth noting that you cannot switch branches while you relocate. For instance, if you need to move to a new server AND switch to a branch, do it in two separate steps.

Refer to the svnbook for more information:

Posted by Greg on February 5th, 2013 :: Filed under Programming,Subversion
You can leave a response, or trackback from your own site.

Leave a Reply

Type your comment in the box below: