Saturday 30 December 2006 — This is 18 years old. Be careful.
This is how to move a Subversion repository from one place to another. It’s one of those operations I undertake only infrequently, and so have to re-learn each time. This time, I’m writing it down. In this example, I’m converting a file-based repository to a server-hosted one.
- Make sure your working directory is fully checked-in to subversion, and back it up, just in case.
- Dump the subversion repository. This is done with an svnadmin command:
It will show progress as it dumps each revision to the dumpfile.svnadmin dump c:\svn\foobar | gzip -9 - > foobar.dump.gz
- Create the new subversion repository, however it is that you usually do that. In my case, I use the Subversion control panel at Dreamhost.
- Copy the foobar.dump.gz file up to the server.
- Load the dumpfile into the new repository:
It will show even more verbose progress than dump did, as it rebuilds the repository transaction by transaction.zcat foobar.dump.gz | svnadmin load foobar
- Checkout the new repository to a scratch directory:
svn co http://svn.whatever.com/foobar
- Examine the new scratch directory and your current working directory. Make sure the files are the same, to check that the right content is correctly ensconced in your new repository.
- If all is well, you can switch your working directory to the new repository:
svn switch --relocate file:///c:/svn/foobar http://svn.whatever.com/foobar
Enjoy your new repo.
Comments
Justin: I don't know if Subversion guarantees the repos are the same from one version to another. I may have a more recent version on my machine that the server does. The dumpfile is the guaranteed way to move contents around. Maybe I'm wrong, but this works.
I think annoyance over the fragility of the BerkeleyDB format drove in part the development of the flat file-based repo format, which is now the default. The flat file repo format is much more stable (though slower), but bad experiences from the bdb-only days have trained us to only trust dump and load.
Continuing that paranoia and always using dump and load is probably a good habit to be in, even if not strictly necessary.
http://bazaar-vcs.org/
http://abridgegame.org/darcs/
Add a comment: