Question

I am trying to move a subversion repository to a new server, but leave its mirror where it is. I have done the following:

  1. Dump old repo
  2. Load dump into new repo
  3. Setup the new repo's post-commit hook to svnsync to the existing mirror

The hook:

#!/bin/sh

svnsync --non-interactive sync https://mirror.example.com:443/svn/iaw \
--sync-username svnsyncuser --sync-password svnsyncpass \
--source-username svnsyncuser --source-password svnsyncpass &

exit 0

Predictably, when I try to run this hook from the new repo I get the following:

svnsync: OPTIONS of 'http://oldrepo.url/svn/iaw': Could not resolve hostname `oldrepo.url': Host not found (http://oldrepo.url)

The problem is that the mirror was initialised with the url of the old repo. Does anyone know if this can be changed, or do I need to start again from scratch with a new mirror?

Many thanks

Was it helpful?

Solution

You can use Subversion to edit the revision properties on rev 0 of the mirror repository. I.e.:

svn propset --revprop -r0 svn:sync-from-url http://newrepo.url/svn/iaw \
    https://mirror.example.com:443/svn/iaw

See the box titled "svnsync Bookkeeping" in the Repository Replication section of the SVN book.

OTHER TIPS

All your sync information of mirror svn is stored in /repo/db/revprops directory. In the directory, you can see files like: 0, 1, 2,

grep -R "http://oldrepo.url" /repo/db/revprops

and after you find it, modify it to new repo address, and it can work now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top