Debian 6 update broke my subversion repositories!

I recently upgraded my Debian Linux server from version 5 (codename “Etch”) to version 6 (codename “Squeeze”). Considering the size of the upgrade, everything seemed to go very well with only a couple of minor problems during the upgrade. Or so I thought…

The first time I tried to access one of the subversion repositories on my server I encountered the following cryptic error:

svn: OPTIONS of 'https://myserver/svn/myrepo/myproject/trunk': could not connect to server (https://myserver)

I also saw the following error several times too:

svn: Could not open the requested SVN filesystem

After trying an svnlook tree on one of my repos, it reported the following:

# svnlook tree /var/svn/myrepo/
svnlook: Berkeley DB error for filesystem '/var/svn/myrepo/db' while opening environment:
svnlook: DB_VERSION_MISMATCH: Database environment version mismatch
svnlook: bdb: Program version 4.8 doesn't match environment version 4.6

So, it looks like the Debian upgrade has broken my subversion repository access because the version of the Berkeley DB being used has changed! Nice!

After a bit more Googling I found this great blog post which guides you through how to migrate a BDB based svn repository from one version to another. The process basically involves using a couple of BDB utilities for each version of BDB involved (4.6 and 4.8 in my case) to recover the old repository. The blog post also discusses how to migrate a BDB based repository to an FSFS based one which is apparently the recommended repository format these days.