4

We have a Ubuntu(head-less) system that runs our SVN repository(ies). Would like to regularly back it up to a Windows share automatically. What should we do ? Any links/articles ? Any gotchas ?

How easy is it to restore from these backups ?

3 Answers 3

4

$ svnadmin dump /path/to/repo | gzip > backup.gz

$ gunzip -c backup.gz | svnadmin load /path/to/repo

1

Tar it up, then use gvfs-copy to copy it over, or mount the share as CIFS, copy, and unmount.

1

Further to Rajat's anwswer, if your Ubuntu system has the space I would do a hotcopy first and then either dump the hotcopy or tar it up.

$ svnadmin hotcopy /path/to/repo /path/to/local/backup
$ svnadmin dump /path/to/local/backup | gzip > backup.gz
  or
$ tar czf backup-hotcopy.tgz /path/to/local/backup

Thus,

  • you have a local backup if the repo gets corrupted.
  • the backup can be done without any outages - it can be done whilst dev's are commiting to the database. (IIRC the dump command may not work cleanly on a live repo - but I can't find a definitive source on this after doing a quick search - someone correct me if I'm wrong or point to confirmation)
  • The local hotcopy will also include any hook scripts that you may have setup - whereas the dump will not.

However, the tar'd up hotcopy contains a repository in Linux format. This may cause issues if your Ubuntu box dies and you want to restore onto a Windows machine. (This one bit me once - we needed to restore quickly and a windows box was the only server available). This is not an issue with the dump variant. You'll need to create a working reposity somewhere first - but having done so the dump can be loaded without any care as to the underlying OS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .