tags:

views:

421

answers:

4

We connect to the repository by ip address - a quick hack introduced by the guy before me, since we don't have a real server, just an old pc running apache, svn etc. We recently moved offices and it seems the "server" is using DHCP - it booted to a new IP address this morning. Logging into trac (also running on that server) is easy: Just change the bookmark in the browser.

But what do I do about my working copy? How can I tell that where to find the server?

+10  A: 

Do an svn switch and use the --relocate option:

http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.switch.html

(or in TortoiseSVN, right-click -> TortoiseSVN -> Relocate...)

The relocate does not require repository access and is meant exactly for the case where the content is the exact same but the repository base is changed.

Amber
I'm getting an Error on the switch command: 'http://xxx.yyy.zzz.1/RepositoryName' is not the same repository as 'http://xxx.yyy.zzz.2/RepositoryName'. Do you have an idea why?
Daren Thomas
I'd suggest you also give the server a name in /etc/hosts and use that instead - at least if the IP changes again you won't have to reconfigure everything.
Ant P.
waht actual command did you use?
Frank Bollack
incredible_Honk: I used the TortoieSVN->Relocate method since I haven't got the CLI for SVN installed yet (though I normally prefer to do this stuff on the command line - somehow I find it soothing to be able to use the official SVN docs to get things right...)
Daren Thomas
I updated the link to the 1.5 version of the book. Google likes returning results to the 1.0 version, which is massively out of date.
R. Bemrose
+3  A: 

Davs answer points to the right chapter, but to be more precise, its actually the command

svn switch --relocate [old URL] [new URL]

which maps to the TortoiseSVN command TortoiseSVN -> Relocate

Frank Bollack
+4  A: 

Dav's answer (using svn switch with --relocate) is the proper answer, but before you do that, I have one other suggestion: Use a DNS name. Since it sounds like you don't have a DNS server, add an entry to your hosts file pointing to the IP address. Then if the IP address changes again, all you need to do is have each person update the hosts file on there machine.

Adam Batkin
Thanks. Will be looking into that when I next have time (i.e. the next time this happens...)
Daren Thomas
+3  A: 

Consider setting up DNS for the subversion server - you can use an internal DNS server, a free DNS hosting service, whatever. Doesn't mean the server has to be publicly accessible across the internet, you can have the DNS lookups return a LAN IP. That'll make it a lot less painful the next time the server changes IP.

When that part has been done, relocate the repository location like described in other answers.

snemarch