How to migrate all URLs in svn:externals properties across a repository?

后端 未结 6 705
花落未央
花落未央 2020-12-06 01:17

We are in the process of moving our SVN repositories from one machine to another one, and with it will come a new domain name for the new repo. The problem is, that within

6条回答
  •  孤街浪徒
    2020-12-06 02:15

    As you indicated that you still want to be able to check out older revisions, the only solution is really to "rewrite" the entire history (solution D mentioned earlier).

    To do this, you should:

    1) Dump the contents of the entire repository using svnadmin dump:

    $ svnadmin dump /path/to/repos > original-dumpfile
    * Dumped revision 0.
    * Dumped revision 1.
    * Dumped revision 2.
    * Dumped revision 3.
    

    2) Edit the dump file, to change the svn:externals URLs. This is the most difficult part: Assuming the repository contains binary data as well, opening the dump file in a plain text editor will most likely corrupt the dump file. I've had good experiences using a so-called "hex-editor", for instance the Freeware Hex Editor XVI32

    3) Create a new repository and load the modified dumpfile into it:

    $ svnadmin create newrepos
    $ svnadmin load newrepos < modified-dumpfile
    

    For more information, you might also be interested in this link:
    http://svnbook.red-bean.com/en/1.1/ch05s03.html

    NOTE: Subversion 1.5 actually added support for relative URLs in the svn:externals property, which can precisely prevent these sort of problems in the future:
    http://subversion.tigris.org/svn_1.5_releasenotes.html#externals

提交回复
热议问题