2

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:?

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
nonopolarity
  • 146,324
  • 131
  • 460
  • 740

5 Answers5

7

You have a number of options:

Jonathan Holloway
  • 62,090
  • 32
  • 125
  • 150
2

check out the

svnadmin dump

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

Aaron
  • 829
  • 6
  • 12
2

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
  • 9,861
  • 4
  • 34
  • 55
2

Get a copy of hot-backup.py.

Then create a new Sheduled Task to execute the python 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 python installed to run the script.

martin clayton
  • 76,436
  • 32
  • 213
  • 198
John Simons
  • 4,288
  • 23
  • 41
0

If you are on Linux server then create snapshots of repository weekly or hourly.

or

You can go for

svnadmin dump or svnadmin hotcopy

After create the zip of it.

SteveScm
  • 545
  • 1
  • 7
  • 15