How do I export (and then import) a Subversion repository?

后端 未结 11 1300
一向
一向 2020-12-02 05:47

I\'m just about wrapped up on a project where I was using a commercial SVN provider to store the source code. The web host the customer ultimately picked includes a reposito

相关标签:
11条回答
  • 2020-12-02 06:27

    Basically, there are plenty of ways to accomplish the task. The topic is covered in depth in SVNBook | Migrating Repository Data Elsewhere, so I suggest reading the book's section.

    Here is a brief description of your options:

    • It depends on your environment, but there is a great chance that you can simply copy the repository to the new server and it will work. You have to revise repository hook scripts after copying the repo to ensure that they are working as you expect.

    • You can use svnadmin dump and svnadmin load commands to, ehm, generate full dump and then load it to another repository on another server. You will need to svnadmin create a new clean repository to load the dump into it. Keep in mind that the approach deals with repository history only and does not move hook scripts and repository configuration files! As well, you must have read filesystem access to the original repository to dump it.

    • Since Subversion 1.7, svnrdump tool is available. Generally speaking, it mimics svnadmin dump and svnadmin load functionality, but operates remotely. You are not required to have read / write filesystem access to original and target repositories as tool operates remotely like Subversion client, e.g. over HTTPS protocol. So you need to have read access to original repository and read / write to the target one.

    • Another option is to use svnadmin hotcopy command. The command is mostly used for backup purpose, it creates full copy of the repository including configuration and hook scripts. You can move hotcopied repository to another server then.

    0 讨论(0)
  • 2020-12-02 06:27

    You might find some help on migrating SVN repositories in Chapter 5. Repository Administration, Migrating a repository.

    This approach requires access to svnadmin.

    0 讨论(0)
  • 2020-12-02 06:28

    If you do not have file access to the repository, I prefer rsvndump (remote Subversion repository dump) to make the dump file.

    0 讨论(0)
  • 2020-12-02 06:32

    You can also use the svnadmin hotcopy command:

    svnadmin hotcopy OLD_REPOS_PATH NEW_REPOS_PATH
    

    It takes a full backup from repository, including all hooks, configuration files, etc.

    More at SVN Book

    0 讨论(0)
  • 2020-12-02 06:33

    The tool to do that would be

    svnadmin dump
    

    But for this to work, you need filesystem-access to the repository. And once you have that (and provided the repository is in FSFS format), you can just copy the repository to its new location (if it's in BDB format, dump/load is strongly recommended).

    If you do not have filesystem access, you would have to ask your repository provider to provide the dump for you (and make them delete their repository - and hope they comply)

    0 讨论(0)
提交回复
热议问题