Can I create a hosted SVN repository 'parallel' to my own on my office server?

619 views Asked by At

We've been using a DIY SVN server in the office for about a year now. It's a simple setup with SVN installed on a home server. We use tortoise SVN to access it I just wish I'd learnt about a version contol system years ago.. Anyway, of course access to the server is perfect in the office on the 1Gbps LAN but outside it's useable but poor, limited by the 50k bytes/sec upload speed of our ADSL line to the web. I guess this may improve one day with 'infinity' but we may die waiting.

I'd like to have a 'parallel' repository hosted, for which I realise I shall pay, where access is much faster. This would also give us an additional backup. My repo is just under 40G, so a 100G limit would be ok. Is there a way of doing this and making the two as mirrors such that commits (small at least) are visible on both almost immediately? I'm alreadyusing the Svnbackup command to make a parallel mirror on our server so can this work both ways?

Any suggestions or alternatives appreciated.

TIA Brian

3

There are 3 answers

2
Rudi On

Do you want a read-only server, or read+write access to more than one server? When you only need a read-only mirror, you can use svnsync to replicate your office server to a mirror server.

When you want to commit from different places, have a look at a distributed tool like hg+hgsubversion or git-svn, which both can be used as asynchronous clients for svn.

0
yankee On

The standard Linux SVN server has hooks that allow you to run your own scripts on events. You can use the post-commit hook (just place a script named "post-commit" in the "hooks"-directory).

Now you can either just issue a hotcopy of the entire repository, which is rather easy to setup (svnadmin hotcopy from to) and copy the repository to the other host on the internet using ssh or the like. You can do this on both machines and you are good.

Drawbacks:

  • If your repository is big, then this takes lots of time
  • Beware of the possibility that someone commits to one repository and someone else to the other repository simultaneously. This could well corrupt everything. You must make sure that this does not happen or find a way lock your repository (like shut down svn during the copying process)
  • You need shell access to both machines

You may be able to speed things up by saving the repository to a local file and only transmit diffs to the other machine.

0
gbjbaanb On

What I think you really need is a slave proxy - this is a copy of a subversion server for read-only access, when you write (to it), the commits are passed straight to the master. As you read a lot more than write, this provides a simple but effective way to achieve what you want.

There's plenty of tutorials on the web, but they all require you to run subversion using http access (not svnserve). The slave is kept up to date through the excellent svnsync and a post-commit hook.