9
votes

I have a Windows Server 2008 with VisualSVN Server hosting a repository. On the client computers I have TortoiseSVN client.

How can I create a backup of my repository that is hosted on the server and then restore it?

2

2 Answers

13
votes

From http://www.visualsvn.com/support/topic/00012/ :


You can backup your repositories using svnadmin hotcopy Subversion command. For further details please refer to the Subversion documentation.

Please note that all other VisualSVN Server related data (such as user rights settings) are stored in your repositories topmost folder (C:\Repositories by default). You should backup them separately.


To save the data only (without hooks, configuration, etc.), use svnadmin dump. You can even use it incrementally.

Starting with Subversion 1.7 you can run svn dump remotely via svnrdump.

Depending on your backup capacity you may choose to always do hotcopy, or do hotcopy once in a while, complete svn dump more often, and incremental svn dump every night, etc.

9
votes

Starting with VisualSVN Server 3.6 version, the server includes a built-in scheduled repository backup and restore feature. Moreover, the 3.6 release adds scheduled verification of SVN repositories.

Setting up scheduled repository backup and verification for your Subversion repositories is only a matter of minutes. For step-by-step instructions, please see the article KB106: Getting Started with Backup and Restore.

If you look for a one-time backup, you could use Backup-SvnRepository PowerShell cmdlet. To recover the repository, use Restore-SvnRepository.

Download the latest version of VisualSVN Server from the main download page.

enter image description here


There are several other methods to backup VisualSVN Server repositories. Check the short description below.

1. svnadmin hotcopy tool

svnadmin hotcopy allows you to make a safe copy of the repository, regardless of whether other processes are using the repository. You may write a custom script which will do the backup for your repositories on a regular basis.

You can consider the following article from SVNBook to learn more about Subversion repositories backup: http://www.visualsvn.com/support/svnbook/reposadmin/maint/#svn.reposadmin.maint.backup

2. svnsync tool

This is the incremental backup method. Incremental backup method backups only the portion of the repository data that has changed since the previous backup. You can set up this tool to work as "master" and "slave" and duplicate any commits to its repositories automatically.

See the "svnsync" article for further details: http://www.visualsvn.com/support/svnbook/ref/svnsync/

3. Volume Shadow Copy backup

VisualSVN Server and all configurations related to it can be backed up using the Volume Shadow copy.

Though there might be a problem if you make a Volume Shadow Copy while somebody commits to Subversion repository, the last revision of the repository probably might be corrupted. However it can be easily recovered using svnadmin recover command.

Except repositories, you should backup the following pieces of information:

  1. Authentication and authorization files that are stored in the repositories root ('C:\Repositories' by default). Depending on your settings, there should be the following files: 'authz', 'authz-windows' and 'htpasswd'.

  2. %VISUALSVN_SERVER%\certs\ folder where information about your SSL-certificates is stored.

  3. %VISUALSVN_SERVER%\conf\ folder where configuration files of your VisualSVN Server are stored.

  4. HKEY_LOCAL_MACHINE\SOFTWARE\VisualSVN\VisualSVN Server\ registry key where other part of server's configuration is stored.