Monday, April 20, 2009

Upgrading A Subversion Repository

I recently had to move several Subversion repositories from one server to another. Normally, this isn't a big deal, but these repositories were using an old version of Subversion (1.4.something) and had to be upgraded to 1.6.1 which was an entirely different file format. I was able to find the following documentation which fortunately made the process very simple. The following is taken from the Collabnet site. I actually only needed steps 1 and 2. Hope this helps.

HOW TO UPGRADE/DOWNGRADE YOUR REPOSITORY:
----------------------------------------

1. Use an 'svnadmin' binary from a release with the same schema version
as your repository to create a dumpfile of your repository:

$ mv myrepos old-repos
$ svnadmin dump old-repos > dumpfile

2. Use an 'svnadmin' binary from a release with the same schema version
as you want your repository to have to load the dumpfile into a new
repository:

$ svnadmin create myrepos
$ svnadmin load myrepos < dumpfile

OR, if you're feeling saucy, you can do it all at once with a pipe:

$ svnadmin-new create myrepos
$ svnadmin-old dump old-repos | svnadmin-new load myrepos

(If you are running at least version 1.4 and would like to make a
format 3 repository, pass the --pre-1.4-compatible flag to
"svnadmin create".)

3. [OPTIONAL] Loading a dumpfile is both time- and disk-consuming,
as it replays every commit. If your new repository is a BDB
respository, then after the load is complete, you may want to
free up some disk space by removing unused BerkeleyDB logfiles:

$ svnadmin list-unused-dblogs newrepos | xargs rm

Note: If you're using BerkeleyDB 4.2 or newer this will be done
automatically for you, unless you've configured the repository
not to behave this way.

4. Don't forget to copy over any hook scripts (and DB_CONFIG for BDB
repositories, if you changed it) from the old to the new
repository:

$ cp old-repos/hooks/* repos/hooks/
$ cp old-repos/db/DB_CONFIG repos/db/

No comments:

Post a Comment