How do I back up a remote SVN repository

后端 未结 9 673
生来不讨喜
生来不讨喜 2020-12-22 20:28

I am currently moving my SVN server from my home server to my remote server so I can access it more easily from other locations. My remote server is not backed up so I want

相关标签:
9条回答
  • 2020-12-22 20:50

    Just use the svnsync command.

    First, create a fresh repository on your home machine.

    svnadmin create c:\backuprepo
    

    Or on Unix:

    svnadmin create ./backuprepo
    

    Next, create a file named pre-revprop-change.bat:

    echo exit 0 > c:\backuprepo\hooks\pre-revprop-change.bat
    

    Or on Unix:

    echo -ne '#!/bin/sh\nexit 0' > ./backuprepo/hooks/pre-revprop-change
    chmod ugo+x ./backuprepo/hooks/pre-revprop-change 
    

    then, initialize the sync:

    svnsync init file:///c:/backuprepo https://url/of/your/repository
    

    Or on Unix:

    svnsync init file:///Volumes/volumelabel/backuprepo https://url/of/your/repository
    

    After that, you can simply run

    svnsync sync file:///c:/backuprepo
    

    once a day or so, and you'll get only those changes which are not yet in your backup repository. The first time it will take a while, but after you've synchronized your backup repository with the real one, it will only take a few seconds to sync it because only those revisions that are new need to be synched.

    0 讨论(0)
  • EFraim mentioned rsync while I wrote this so that's covered.

    If you don't want to work with that, the Subversion Book offers the svnadmin dump --incremental option explained here:

    • Repository Maintenance (scroll down the page to the "backup" section)
    • Migrating a repository has examples on svnadmin dump --incremental

    However, to do this successfully, you have to juggle with revision numbers - rsync'ing the raw repository data directories will be easier.

    The hard part will probably be setting up rsync so your local and remote machine can communicate securely (i.e. set up an SSH service on the 2003 server). DeltaCopy that Wim mentions is very interesting and would be my first shot; for command line operation only, here is a howto on how to get Rsync running as a service on Windows 2003.

    0 讨论(0)
  • 2020-12-22 20:51

    In Mac OS X 10.10, the svnrdump command is located here:

    • /Library/Developer/CommandLineTools/usr/bin/svnrdump

    You can then use the answer above by joesdiner.

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