How do I migrate an SVN repository to another SVN repository?

前端 未结 9 832
小蘑菇
小蘑菇 2020-12-07 13:07

Is there a simple way to copy a directory from one repository into another repository with copying all of the history?

相关标签:
9条回答
  • 2020-12-07 13:58

    Use the svnsync — Subversion Repository Mirroring command:

    svnsync is the Subversion remote repository mirroring tool. Put simply, it allows you to replay the revisions of one repository into another one.

    The Subversion documentation for the svnsync command has the following warning (as of version 1.7) implying that once some other SVN commands are used to modify a mirror repository, svnsync should not be used with that particular mirror again:

    svnsync is very sensitive to changes made in the mirror repository that weren't made as part of a mirroring operation. To prevent this from happening, it's best if the svnsync process is the only process permitted to modify the mirror repository.

    0 讨论(0)
  • 2020-12-07 14:01

    You can create a dump file using svnadmin dump, then import to a new repository with svnadmin load.

    0 讨论(0)
  • 2020-12-07 14:05

    As suggested in the Subversion book:

    svnadmin dump path/to/repos_src \
        | svndumpfilter include path/inside/svn/to/directory \
        | svnadmin load path/to/repos_dst
    

    With an example:

    svnadmin dump /var/lib/svn/old_repo \
        | svndumpfilter include trunk/my_project/common_dir \
        | svnadmin load /var/lib/svn/new_repo
    
    0 讨论(0)
提交回复
热议问题