Our Service

How do I make an export (local backup) of my repository?

Support » Our Service » How do I make an export (local backup) of my repository?

Exporting and backing up your repository with svnsync

You can easily make a local backup of your full repository with the svnsync tool.

The procedure is as follows:

  1. Find the URL for your repository. Here, we’ll assume the repository URL is https://svn.sliksvn.com/your_repo.
  2. Get the Subversion command-line client. On the command prompt, try typing svnsync If this command is not successful, install a Subversion client, such as SlikSVN for Windows.
  3. Create a Subversion repository on your local hard drive:
    svnadmin create backup_repo
  4. You now have a backup_repo directory on your local system, containing an empty Subversion repository.
  5. Determine the URL for the backup repository. Here, we’ll assume the directory is /Users/name/backup_repo, so its URL is file:///Users/name/backup_repo. If you are using Windows, the URL will have the form of file:///C:/Users/name/backup_repo (containing forward slashes).
  6. If you use a Unix system, create a pre-revprop-change hook as follows:
    echo '#!/bin/sh' > backup_repo/hooks/pre-revprop-change

    Then run:

    chmod 755 backup_repo/hooks/pre-revprop-change
  7. If you use a Windows system, create the pre-revprop-change hook like this:
    echo > backup_repo\hooks\pre-revprop-change.bat
  8. Run the following command to initialize the sync:
    svnsync init file:///Users/name/backup_repo https://svn.sliksvn.com/your_repo
  9. Run the following command to synchronize:
    svnsync sync file:///Users/name/backup_repo
  10. You can always re-run the sync command later, in order to download the newest revisions from the remote.
  11. If you want to create a dump file, use:
    svnadmin dump backup_repo > backup_repo.svn