Moving a Subversion repository to another server

前端 未结 6 410
闹比i
闹比i 2020-12-22 16:40

I have a server that hosts my Subversion code base. That server is currently a Windows Server 2003 box, and my IT administrator wants to update it to Windows Server 2008.

相关标签:
6条回答
  • 2020-12-22 17:10

    Yes, dumping and loading the repository is a way to go. Copying the repository folder directly is a viable option if, and only if, you are certain nobody will be accessing the repository while the copy process is in progress (or you can do a "hot copy" of the repository, which can handle these cases in a safe manner).

    You will also need to either re-checkout all your working copies, or use the svn switch command, which merely rewrites URLs. A more convenient way is to use TortoiseSVN's Relocate command, which reduces the risk of making a mistake during the relocation process.

    0 讨论(0)
  • 2020-12-22 17:13

    If you are using the File System type repository, you can just literally take the folder containing your repository and move it. If you are changing servers, then chances are you will need to change the location that your local working directory looks for the repository by using the 'Relocate' command.

    0 讨论(0)
  • 2020-12-22 17:29

    My restore scripts are like this:

    svnadmin create repository-name --fs-type fsfs
    svnadmin load   repository-name --force-uuid < repository-name.dmp
    

    The first line ensures the repository uses the FSFS backend (which is recommended by many sources, including this one: How FSFS is Better, and AFAIK newer versions of Subversion use it as default). FSFS is the name of a Subversion filesystem implementation.

    The second lines keeps the UUID of the repository, for an easier transition (without --force-uuid switch, the working copy relocation will fail).

    Some links:

    • Subversion admin - moving repository around
    • Moving a Subversion Repository to Another Server
    0 讨论(0)
  • 2020-12-22 17:32

    The easiest way is to use:

    svnadmin hotcopy path/to/your_current_directory /path/to/your_destination_directory
    
    0 讨论(0)
  • 2020-12-22 17:34

    You can also use svnsync to move the repository; that way you can transfer all the data without the need to take the 'old' repository down. This is also the only way I know of to get your data from hosted environments, where you don't have shell access or access to dumping the repository.

    0 讨论(0)
  • 2020-12-22 17:35

    Another alternative:

    use svnrdump. http://www.crowbarsolutions.com/backing-up-restoring-a-remote-svn-repository/

    "You’re going to need a a tool called svnrdump. As described by Apache, “svnrdump replicates the functionality of svnadmin dump and svnadmin load, but works on remote repositories, instead of needing administrator (local filesystem) access to the source or target repository.”

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