views:

807

answers:

5

is there a good way to back up all the code and content on an SVN server? because if that hard drive dies, then all work can be lost.

i think if we use multiple computers to SVN Update to it regularly, the most of the files are present on those machines, and therefore the code are somewhat safer not to be lost.

i was also thinking of writing a script to copy the c:\repositories to w:\, which is a 2TB external hard drive that is mostly idle during the day. the copy process can be run nightly by cron or windows scheduler... but will copying everything be an overkill? it may be a dozen files that got changed during the day, which total to be 0.5MB, and copying the whole repositories may involve 50MB or more. and what if i was doing SVN check-in while that cron job is running. won't those files be in an inconsistent state?

or what about have the repository at c:\ so that SVN update is fast (the w: drive need time to wake up if idle for too long), and then just create a project under w:\ and check out all files to w:\all_code and it will SVN update to the whole repository, and then run cron jobs to SVN update w:\ to sync to the repository every night, so that an extra copy of all the files are on w: ?

+2  A: 

check out the

svnadmin dump

command. http://svnbook.red-bean.com/en/1.1/re31.html

Aaron
+1  A: 

Found this in Google:

http://justinram.wordpress.com/2006/05/03/subversion-server-windows-backup/

Most hits were for for Linux, but that one is a Windows specific answer. Make sure you pay attention to the part about users having files checked out/changes to files.

Gromer
+4  A: 

You have a number of options:

Jon
A: 

We can assume you have RTFM?

Personally as a remote svn admin I perform hourly svnsync to satisfy my own personal paranoia if, for whatever reason, our sysadmin guys get something wrong with the daily backup from data center to office rack, which is done after an svnadmin hotcopy.

We also do daily svnadmin verify against our repositories.

Si
+2  A: 

Get a copy of hot-backup.py. Then create a new Sheduled Task to execute the pyton script every night: Here is an example of what I pass to the script: *"C:\Program Files\Python25\python.exe" D:\SvnBackupUtil\hot-backup.py --archive-type=zip --num-backups=30 C:\Repositories\svn_root \core-ad01l\backup*

This example creates a zip backup of the repository to \core-ad01l\backup\ and keeps a maximum of 30 backups.

You need pyton installed too.

John Simons