Creating an SVN backup with svnsync

CloudForge continuously backs-up all repository data throughout the day. At the end of each day, if any data has changed from the previous day, we store a new snapshot of your repository. If you would like a near real time backup, or would like incremental backups (mirroring) of your Subversion repository we recommend using 'svnsync'. In this article, we show you how to mirror your SVN repository using svnsync.

You can create a copy of a remote repository on your local machine using the svnsync utility. This utility is part of the standard svn command line package. The following instructions assume that you have already installed this. Note that the examples are on a Unix machine, but the same approximate commands should work with Windows.

  1. Create a repository on your local machine using 'svnadmin create':
    $ svnadmin create local_repo
  2. Create a pre-revprop-change file in the new repositories 'hooks' directory:
    $ vim local_repo/hooks/pre-revprop-change
  3. Put the following into this new file:
    #!/bin/sh
    exit 0
  4. Make that file executable:
    $ chmod +x local_repo/hooks/pre-revprop-change
  5. Prepare the local repository to receive the sync:
    $ svnsync init file:///path/to/local_repo URL_of_remote_repository
  6. Actually perform the sync:
    $ svnsync sync file:///path/to/local_repo

Once this final command completes you will have a complete copy of your Subversion repository on your local system.

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.