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 ?
$ svnadmin dump /path/to/repo | gzip > backup.gz
$ gunzip -c backup.gz | svnadmin load /path/to/repo
Tar it up, then use gvfs-copy
to copy it over, or mount the share as CIFS, copy, and unmount.
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,
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) 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.