Svn relocate, Move your repository
What happens when your svn server changes location / domain name or the administrator changes the url pattern for your repository? You need to tell your working copy to look elsewhere for the repository. Relocate is your friend!From time to time server changes happen or administrators update and need to make changes on the svn servers. But what happens if with your working copies then? Unfortunately your svn working copy can’t guess where the svn server is when you move it… You need to use something called “svn relocate”.
There are two ways to to get a working copy able to update when an administrator changes domain name or location of the svn server. One is good the other is bad.
- The bad one is to checkout a brand new copy of the repository.
- The good one is to use a svn command called svn relocate which is available via svn switch.
Relocate is to be used when the svn server changes domain name or the repository has a completely new directory structure (base directory). Don’t use it if your working copy is moved inside the base url! (read more in the manual if you are unsure).
Let’s say your svn server had the name svn.domain1.com and you have a new server called svn.domain2.com. If you try to run svn up on your working copy it will try to contact the old server. To change your working copy to work against svn.domain2.com use this command, but first move into the base of the working copy.
svn switch –relocate svn://svn.domain1.com/var/lib/svn/999tutorials svn://svn.domain2.com/var/lib/svn/999tutorials .
/var/lib/svn/999tutorials is our directory on the svn server for this repository. Change it to reflect your repository. The dot in the end of the line is important, it tells the command that the working copy is in This directory so don’t forget it! To find the information about where the repository has it’s svn server and url use the command svn info.
After you have relocated your working copy, just run the command svn up to update to last revision.

Leave a Reply