How to get your files out of a svn dump

Posted on Mon 21 December 2009 in misc

After a hosting provider-switch I received a (gzipped) dump-file containing my subversion-repository. As I have precious little svn-administration experience, I was unsure how to handle the dump-file. Google initially send me in the wrong direction (dump/restore), but the second try was more productive.

I have no intention of running a svn-repository (partial to git), I just needed the files of the last revision. The following commands will accomplish this.

# unzip the dump-file
$ gunzip backup.dump.gz                 
# create a directory for the repository
$ mkdir backup_repo                     
# initiate a svn-repository
$ svn init backup_repo                  
# load the dump-file
$ sudo svnadmin load backup_repo < backup.dump  
# temporary host the repository
$ svnserve -r backup_repo/ -d           
# export the files
$ svn export svn://localhost backup

This will result in a folder "backup" with the last version of all the files in the repository, without the .svn directories.