How to backup and restore an SVN repository with full commit history

Sometimes you need to move an SVN repository from one server to another but maintain the full commit history (i.e. comments and changes). Here is a very simple way to do so.

1. Dump (and compress) the source SVN in one line:

svnadmin dump [path to source SVNrepository] | gzip -9 > [path to destination gzipped dump file]

For example:

svnadmin dump /var/svn/projectx | gzip -9 > /home/awesomeadmin/svn_backup/projectx.dump.gz

2. Transfer gzipped dump to new server

3. Decompress dump

gunzip projectx.dump.gz

4. Restore dump to new SVN repository

svnadmin load [path to new SVN repository] < [path to dump file]

For example:

svnadmin load /var/svn/projecty < /home/awesomeadmin/svn_backup/projectx.dump

That’s it. Pretty simple, no?



Be the first to comment

Leave a Reply

Your email address will not be published.


*