开发者

Can a subversion repository be moved, but its mirror remain the same?

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 rep开发者_开发问答o'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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜