Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recover from svn hotcopy backups

Tags:

recovery

svn

Our current backup process is doing a SVN HOTCOPY every night, to a backup location on a different machine. Can I somehow recover from that backup and retain all revision history? Or do I need to use the svn dump/load?

Thanks, Chandrajeet

like image 408
chandrajeet Avatar asked Jan 14 '09 21:01

chandrajeet


3 Answers

"svnadmin hotcopy" actually copies the entire repository to another location. The copy is indistinguishable from the original repository, and can in fact be used as a repository itself. So, you should be able to copy the results of svnadmin hotcopy back to your repository location and have a perfectly valid, restored repository.

The advantage of hotcopy over a regular filesystem copy is that it respects Subversion's locking mechanism.

like image 106
MattK Avatar answered Sep 21 '22 10:09

MattK


As part of your daily backup, you might want to run svnadmin verify <REPOSITORY>

You could either verify the original or the hotcopied.

Definitely do that before restoring from a backup.

like image 8
Jordan Liggitt Avatar answered Sep 20 '22 10:09

Jordan Liggitt


I would do much more then simply run a hotcopy every night. I would use "svnadmin dump" to create a history of revisions into a dumpfile, which can be restored to a working repository.

You should be backing up these dumpfiles to tape or offsite disk as is standard backup procedure. If a corrupt repository persists over several days before it is caught (such as on a weekend or holiday), you can go back to the last good file.

like image 1
Mike Miller Avatar answered Sep 23 '22 10:09

Mike Miller