Monday, December 27, 2010

Dump and Load a SVN Repository

These are the steps I took the last time I needed to move a Subversion (SVN) repository from one machine to another.

* Dump the repository to a file:
   svnadmin dump /path/to/repositories/projectrepo > projectrepo.dump
* If your repository is large, you might want to compress it using your favorite tool. This was on Linux, so:
   gzip projectrepo.dump
* Transfer the repository to the target machine.
* Decompress:
   gzip projectrepo.gump.gz
* Create an empty repository:
   svnadmin create /path/to/new/repositories/projectrepo
* Load the project repository:
   svnadmin load /path/to/new/repositories/projectrepo < projectrepo.dump