<p>I'm new to SVN and I'd like to know what methods are available for backing up repositories in a Windows environment?</p>

[{'answer_id': 33062, 'author': 'Misha M', 'author_id': 3467, 'author_profile': 'https://Stackoverflow.com/users/3467', 'pm_score': 2, 'selected': False, 'text': '<p>I like to just copy the entire repo directory to my backup location.  That way, if something happens, you can just copy the directory back and be ready to go immediately.</p>\n\n<p>Just make sure to preserve permissions, if needed.  Usually, this is only a concern on Linux machines.</p>\n'}, {'answer_id': 33064, 'author': 'Nicolai Reuschling', 'author_id': 2569, 'author_profile': 'https://Stackoverflow.com/users/2569', 'pm_score': 8, 'selected': True, 'text': '<p>You could use something like (Linux):</p>\n\n<pre><code>svnadmin dump repositorypath | gzip &gt; backupname.svn.gz\n</code></pre>\n\n<p>Since Windows does not support GZip it is just:</p>\n\n<pre><code>svnadmin dump repositorypath &gt; backupname.svn\n</code></pre>\n'}, {'answer_id': 33068, 'author': 'RobotCaleb', 'author_id': 1621, 'author_profile': 'https://Stackoverflow.com/users/1621', 'pm_score': 3, 'selected': False, 'text': '<ul>\n<li><p>You can create a repository backup (<em>dump</em>) with <a href="http://svnbook.red-bean.com/en/1.7/svn.ref.svnadmin.c.dump.html" rel="nofollow noreferrer"><code>svnadmin dump</code></a>.</p></li>\n<li><p>You can then import it in using <a href="http://svnbook.red-bean.com/en/1.7/svn.ref.svnadmin.c.load.html" rel="nofollow noreferrer"><code>svnadmin load</code></a>.</p></li>\n</ul>\n\n<p>Detailed reference in the SVNBook:\n<a href="http://svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.html#svn.reposadmin.maint.migrate.svnadmin" rel="nofollow noreferrer">"Repository data migration using svnadmin"</a></p>\n'}, {'answer_id': 33072, 'author': 'Adam', 'author_id': 3142, 'author_profile': 'https://Stackoverflow.com/users/3142', 'pm_score': 4, 'selected': False, 'text': '<p><a href="http://svnbook.red-bean.com/nightly/en/svn.ref.svnadmin.c.hotcopy.html" rel="noreferrer">svnadmin hotcopy</a></p>\n\n<pre><code>svnadmin hotcopy REPOS_PATH NEW_REPOS_PATH\n</code></pre>\n\n<blockquote>\n  <p>This subcommand makes a full “hot” backup of your repository, including all hooks, configuration files, and, of course, database files. </p>\n</blockquote>\n'}, {'answer_id': 33082, 'author': 'Kevin Dente', 'author_id': 9, 'author_profile': 'https://Stackoverflow.com/users/9', 'pm_score': 5, 'selected': False, 'text': '<p>There\'s a hotbackup.py script available on the Subversion web site that\'s quite handy for automating backups.</p>\n\n<p><a href="http://svn.apache.org/repos/asf/subversion/trunk/tools/backup/hot-backup.py.in" rel="noreferrer">http://svn.apache.org/repos/asf/subversion/trunk/tools/backup/hot-backup.py.in</a></p>\n'}, {'answer_id': 33088, 'author': 'crashmstr', 'author_id': 1441, 'author_profile': 'https://Stackoverflow.com/users/1441', 'pm_score': 2, 'selected': False, 'text': '<p>If you are using the FSFS repository format (the default), then you can copy the repository itself to make a backup. With the older BerkleyDB system, the repository is not platform independent and you would generally want to use svnadmin dump.</p>\n\n<p>The <a href="http://svnbook.red-bean.com/en/1.8/svn.reposadmin.maint.html#svn.reposadmin.maint.backup" rel="nofollow noreferrer">svnbook documentation topic for backup</a> recommends the <code>svnadmin hotcopy</code> command, as it will take care of issues like files in use and such.</p>\n'}, {'answer_id': 33114, 'author': 'Duncan Smart', 'author_id': 1278, 'author_profile': 'https://Stackoverflow.com/users/1278', 'pm_score': 7, 'selected': False, 'text': '<p>We use svnadmin hotcopy, e.g.:</p>\n\n<pre><code>svnadmin hotcopy C:\\svn\\repo D:\\backups\\svn\\repo\n</code></pre>\n\n<p>As per <a href="http://svnbook.red-bean.com/nightly/en/svn.ref.svnadmin.c.hotcopy.html" rel="noreferrer">the book</a>:</p>\n\n<blockquote>\n  <p>You can run this command at any time and make a safe copy of the repository, regardless of whether other processes are using the repository.</p>\n</blockquote>\n\n<p>You can of course ZIP (preferably 7-Zip) the backup copy. IMHO It\'s the most straightforward of the backup options: in case of disaster there\'s little to do other than unzip it back into position.</p>\n'}, {'answer_id': 33190, 'author': 'Tom Mayfield', 'author_id': 2314, 'author_profile': 'https://Stackoverflow.com/users/2314', 'pm_score': 4, 'selected': False, 'text': '<p>I use <a href="http://svn.apache.org/repos/asf/subversion/trunk/notes/svnsync.txt" rel="noreferrer">svnsync</a>, which sets up a remote server as a mirror/slave.  We had a server go down two weeks ago, and I was able to switch the slave into primary position quite easily (only had to reset the UUID on the slave repository to the original).</p>\n\n<p>Another benefit is that the sync can be run by a middle-man, rather than as a task on either server.  I\'ve had a client to two VPNs sync a repository between them.</p>\n'}, {'answer_id': 37554, 'author': 'quick_dry', 'author_id': 3716, 'author_profile': 'https://Stackoverflow.com/users/3716', 'pm_score': 0, 'selected': False, 'text': '<p>as others have said, hot-backup.py from the Subversion team has some nice features over just plain <code>svnadmin hotcopy</code></p>\n\n<p>I run a scheduled task on a python script that spiders for all my repositories on the machine, and uses hotbackup to keep several days worth of hotcopies (paranoid of corruption) and an <code>svnadmin svndump</code> on a remote machine. Restoration is really easy from that - so far.</p>\n'}, {'answer_id': 717473, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 5, 'selected': False, 'text': '<p>Here is a Perl script that will:</p>\n\n<ol>\n<li>Backup the repo</li>\n<li>Copy it to another server via SCP</li>\n<li>Retrieve the backup</li>\n<li>Create a test repository from the backup</li>\n<li>Do a test checkout</li>\n<li>Email you with any errors (via cron)</li>\n</ol>\n\n<p>The script:</p>\n\n<pre><code>my $svn_repo = "/var/svn";  \nmy $bkup_dir = "/home/backup_user/backups";\nmy $bkup_file = "my_backup-";\nmy $tmp_dir = "/home/backup_user/tmp";   \nmy $bkup_svr = "my.backup.com";\nmy $bkup_svr_login = "backup";\n\n$bkup_file = $bkup_file . `date +%Y%m%d-%H%M`;\nchomp $bkup_file;\nmy $youngest = `svnlook youngest $svn_repo`;\nchomp $youngest;\n\nmy $dump_command = "svnadmin  -q dump $svn_repo &gt; $bkup_dir/$bkup_file ";\nprint "\\nDumping Subversion repo $svn_repo to $bkup_file...\\n";\nprint `$dump_command`;\nprint "Backing up through revision $youngest... \\n";\nprint "\\nCompressing dump file...\\n";\nprint `gzip -9 $bkup_dir/$bkup_file\\n`;\nchomp $bkup_file;\nmy $zipped_file = $bkup_dir . "/" . $bkup_file . ".gz";\nprint "\\nCreated $zipped_file\\n";\nprint `scp $zipped_file $bkup_svr_login\\@$bkup_svr:/home/backup/`;\nprint "\\n$bkup_file.gz transfered to $bkup_svr\\n";\n\n#Test Backup\nprint "\\n---------------------------------------\\n";\nprint "Testing Backup";\nprint "\\n---------------------------------------\\n";\nprint "Downloading $bkup_file.gz from $bkup_svr\\n";\nprint `scp $bkup_svr_login\\@$bkup_svr:/home/backup/$bkup_file.gz $tmp_dir/`;\nprint "Unzipping $bkup_file.gz\\n";\nprint `gunzip $tmp_dir/$bkup_file.gz`;\nprint "Creating test repository\\n";\nprint `svnadmin create $tmp_dir/test_repo`;\nprint "Loading repository\\n";\nprint `svnadmin -q load $tmp_dir/test_repo &lt; $tmp_dir/$bkup_file`;\nprint "Checking out repository\\n";\nprint `svn -q co file://$tmp_dir/test_repo $tmp_dir/test_checkout`;\nprint "Cleaning up\\n";\nprint `rm -f $tmp_dir/$bkup_file`;\nprint `rm -rf $tmp_dir/test_checkout`;\nprint `rm -rf $tmp_dir/test_repo`;\n</code></pre>\n\n<p><a href="http://blog.markwshead.com/101/backing-up-subversion-automatically/" rel="noreferrer">Script source and more details about the rational for this type of backup.</a></p>\n'}, {'answer_id': 790664, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>For the daily and full backup solution just use the <a href="http://www.randombugs.com/linux/subversion-backup.html" rel="nofollow noreferrer">SVN backup scripts here</a>.</p>\n'}, {'answer_id': 2961039, 'author': 'Uwe Keim', 'author_id': 107625, 'author_profile': 'https://Stackoverflow.com/users/107625', 'pm_score': 3, 'selected': False, 'text': '<p><a href="http://code.google.com/p/dotsvntools/" rel="noreferrer">svnbackup</a> over at Google Code, a .NET console application.</p>\n'}, {'answer_id': 5846792, 'author': 'Jose Manuel Ojeda', 'author_id': 731858, 'author_profile': 'https://Stackoverflow.com/users/731858', 'pm_score': 2, 'selected': False, 'text': '<p>there are 2 main methods to backup a svn server, first is hotcopy that will create a copy of your repository files, the main problem with this approach is that it saves data about the underlying file system, so you may have some difficulties trying to repostore this kind of backup in another svn server kind or another machine.\nthere is another type of backup called dump, this backup wont save any information of the underlying file system and its potable to any kind of SVN server based in tigiris.org subversion.</p>\n\n<p>about the backup tool you can use the svnadmin tool(it is able to do hotcopy and dump) from the command prompt, this console resides in the same directory where your svn server lives or you can google for svn backup tools.</p>\n\n<p>my recommendation is that you do both kinds of backups and get them out of the office to your email acount, amazon s3 service, ftp, or azure services, that way you will have a securityy backup without having to host the svn server somewhere out of your office.</p>\n'}, {'answer_id': 6168209, 'author': 'Nitin Verma', 'author_id': 565859, 'author_profile': 'https://Stackoverflow.com/users/565859', 'pm_score': 1, 'selected': False, 'text': '<p>I have compiled the steps I followed for the purpose of taking a backup of the remote SVN\nrepository of my project.</p>\n\n<pre><code>install svk (http://svk.bestpractical.com/view/SVKWin32)\n\ninstall svn (http://sourceforge.net/projects/win32svn/files/1.6.16/Setup-Subversion-1.6.16.msi/download)\n\nsvk mirror //local &lt;remote repository URL&gt;\n\nsvk sync //local\n</code></pre>\n\n<p>This takes time and says that it is fetching the logs from repository. It creates a set of files inside <code>C:\\Documents and Settings\\nverma\\.svk\\local</code>.</p>\n\n<p>To update this local repository with the latest set of changes from the remote one, just run the previous command from time to time.</p>\n\n<p>Now you can play with your local repository (<code>/home/user/.svk/local</code> in this example) as if it were a normal SVN repository!</p>\n\n<p>The only problem with this approach is that the local repository is created with a revision increments by the actual revision in the remote repository. As someone wrote:</p>\n\n<blockquote>\n  <p>The svk miror command generates a commit in the just created repository. So all the commits created by the subsequent sync will have revision numbers incremented by one as compared to the remote public repository.</p>\n</blockquote>\n\n<p>But, this was OK for me as I only wanted some backup of the remote repository time to time, nothing else.</p>\n\n<p>Verification:</p>\n\n<p>To verify, use the SVN client with the local repository like this:</p>\n\n<pre><code>svn checkout "file:///C:/Documents and Settings\\nverma/.svk/local/"  &lt;local-dir-path-to-checkout-onto&gt;\n</code></pre>\n\n<p>This command then goes to checkout the latest revision from the local repository. At the end it says <code>Checked out revision N</code>. This <code>N</code> was one more than the actual revision found in the remote repository (due to the problem mentioned above).</p>\n\n<p>To verify that svk also brought all the history, the SVN checkout was run with various older revisions using <code>-r</code> with 2, 10, 50 etc. Then the files in <code>&lt;local-dir-path-to-checkout-onto&gt;</code> were confirmed to be from that revision.</p>\n\n<p>At the end, zip the directory <code>C:/Documents and Settings\\nverma/.svk/local/</code> and store the zip somewhere. Keep doing this regularly.</p>\n'}, {'answer_id': 8668396, 'author': 'RoughPlace', 'author_id': 468083, 'author_profile': 'https://Stackoverflow.com/users/468083', 'pm_score': 2, 'selected': False, 'text': '<pre><code>@echo off\nset hour=%time:~0,2%\nif "%hour:~0,1%"==" " set hour=0%time:~1,1%\nset folder=%date:~6,4%%date:~3,2%%date:~0,2%%hour%%time:~3,2%\n\necho Performing Backup\nmd "\\\\HOME\\Development\\Backups\\SubVersion\\%folder%"\n\nsvnadmin dump "C:\\Users\\Yakyb\\Desktop\\MainRepositary\\Jake" | "C:\\Program Files\\7-Zip\\7z.exe" a "\\\\HOME\\Development\\Backups\\SubVersion\\%folder%\\Jake.7z" -sibackupname.svn\n</code></pre>\n\n<p>This is the Batch File i have running that performs my Backups</p>\n'}, {'answer_id': 11868183, 'author': 'atx', 'author_id': 1585221, 'author_profile': 'https://Stackoverflow.com/users/1585221', 'pm_score': 3, 'selected': False, 'text': '<p>Basically it\'s safe to copy the repository folder if the svn server is stopped. (source: <a href="https://groups.google.com/forum/?fromgroups#!topic/visualsvn/i_55khUBrys%5B1-25%5D" rel="noreferrer">https://groups.google.com/forum/?fromgroups#!topic/visualsvn/i_55khUBrys%5B1-25%5D</a> )</p>\n\n<p>So if you\'re allowed to stop the server, do it and just copy the repository, either with some script or a backup tool. Cobian Backup fits here nicely as it can stop and start services automatically, and it can do incremental backups so you\'re only backing up parts of repository that have changed recently (useful if the repository is large and you\'re backing up to remote location).</p>\n\n<p>Example:</p>\n\n<ol>\n<li>Install Cobian Backup</li>\n<li><p>Add a backup task:</p>\n\n<ul>\n<li><p>Set source to repository folder (e.g. <code>C:\\Repositories\\</code>),</p></li>\n<li><p>Add pre-backup event <code>"STOP_SERVICE"</code> VisualSVN,</p></li>\n<li><p>Add post-backup event, <code>"START_SERVICE"</code> VisualSVN,</p></li>\n<li><p>Set other options as needed. <em>We\'ve set up incremental backups including removal of old ones, backup schedule,   destination, compression incl. archive splitting etc.</em></p></li>\n</ul></li>\n<li><p>Profit!</p></li>\n</ol>\n'}, {'answer_id': 20362633, 'author': 'ajdev8', 'author_id': 1610035, 'author_profile': 'https://Stackoverflow.com/users/1610035', 'pm_score': 2, 'selected': False, 'text': '<p>For hosted repositories you can since svn version 1.7 use <a href="http://svnbook.red-bean.com/en/1.7/svn.ref.svnrdump.html" rel="nofollow"><code>svnrdump</code></a>, which is analogous to <code>svnadmin dump</code> for local repositories. This <a href="https://help.cloudforge.com/entries/22410698-Exporting-a-CloudForge-Repository-Using-svnrdump" rel="nofollow">article</a> provides a nice walk-through, which essentially boils down to:</p>\n\n<pre><code>svnrdump dump /URL/to/remote/repository &gt; myRepository.dump\n</code></pre>\n\n<p>After you have downloaded the dump file you can import it locally </p>\n\n<pre><code>svnadmin load /path/to/local/repository &lt; myRepository.dump\n</code></pre>\n\n<p>or upload it to the host of your choice.</p>\n'}, {'answer_id': 23921878, 'author': 'Suppaman', 'author_id': 3685361, 'author_profile': 'https://Stackoverflow.com/users/3685361', 'pm_score': 2, 'selected': False, 'text': '<p>Here a GUI Windows tool for make a dump of local and remote subversion repositories:</p>\n\n<p><a href="https://falsinsoft-software.blogspot.com/p/svn-backup-tool.html" rel="nofollow noreferrer">https://falsinsoft-software.blogspot.com/p/svn-backup-tool.html</a></p>\n\n<p>The tool description says:</p>\n\n<p><em>This simply tool allow to make a dump backup of a local and remote subversion repository. The software work in the same way of the "svnadmin" but is not a GUI frontend over it. Instead  use directly the subversion libraries for allow to create dump in standalone mode without any other additional tool.</em> </p>\n\n<p>Hope this help...</p>\n'}, {'answer_id': 27154329, 'author': 'Aamir Shahzad', 'author_id': 2159585, 'author_profile': 'https://Stackoverflow.com/users/2159585', 'pm_score': 0, 'selected': False, 'text': '<p><strong>1.1 Create Dump from SVN (Subversion) repository</strong></p>\n\n<pre><code>svnadmin dump /path/to/reponame &gt; /path/to/reponame.dump\n</code></pre>\n\n<p><strong>Real example</strong></p>\n\n<pre><code>svnadmin dump /var/www/svn/testrepo &gt; /backups/testrepo.dump\n</code></pre>\n\n<p><strong>1.2 Gzip Created Dump</strong></p>\n\n<pre><code>gzip -9 /path/to/reponame.dump\n</code></pre>\n\n<p><strong>Real example</strong></p>\n\n<pre><code>gzip -9 /backups/testrepo.dump\n</code></pre>\n\n<p><strong>1.3 SVN Dump and Gzip Dump with One-liner</strong></p>\n\n<pre><code>svnadmin dump /path/to/reponame | gzip -9 &gt; /path/to/reponame.dump.gz\n</code></pre>\n\n<p><strong>Real example</strong></p>\n\n<pre><code>svnadmin dump /var/www/svn/testrepo |Â gzip -9 &gt; /backups/testrepo.dump.gz\n</code></pre>\n\n<p>How to Backup (dump) and Restore (load) SVN (Subversion) repository on Linux.<br>\n<strong>Ref:</strong> <a href="http://www.if-not-true-then-false.com/2012/svn-subversion-backup-and-restore/" rel="nofollow">svn subversion backup andrestore</a></p>\n'}]
['https://Stackoverflow.com/questions/33055', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3396/']