The fusion of technology, business, and life

Backup a Subversion Repository with svnadmin dump

I recently created a new Subversion repository for a new personal project, and realized I needed to add it to my daily backup script. After a quick bit of searching via Google to refresh my memory, I found exactly what I thought I was looking for:

svnadmin hotcopy /svn /backups/svn --clean-logs

Indeed, O'Reilly's Version Control with Subversion states that svnadmin hotcopy will make a hot copy of a repository, and "is able to make a safe copy of the repository at any time, regardless if other processes are using the repository." However, further research seemed to indicate that the following may be a better option:

svnadmin dump /svn > /backups/svndump-`date %Y%m%d`.dmp

According to several posts on the Subversion mailing list, svnadmin's hotcopy "theoretically needs the correct machine architecture, version of bdb (if it's a bdb repo), and version of Subversion to work"; however, svnadmin's dump could "theoretically be loaded by any future version of Subversion". Whether or not that's actually true, since there are numerous "theoretical" qualifiers, I decided to go with svnadmin dump.

Related Posts

  1. Migrating from subversion to git
  2. cron bug: silently fails when too much output is produced
3 comments

3 Comments so far

  1. Anthony Hildoer December 16th, 2009 5:59 am
  2. admin December 16th, 2009 8:25 am

    @Anthony Cool – thanks for posting it!

  3. [...] script for a Subversion repository that runs in a Debian-based VServer. I previously discussed svn backupsand my script was using the same svnadmin dump technique I mentioned in that [...]

Leave a reply