Migrating bdb svn repositories from one version to another and to fsfs

Today I had to work with a really old svn repository again, which was still in the old bdb format (not in the newer and recommended fsfs one). This caused quite some problems, like, um... you cannot checkout, update, or commit anything.

$ svn co file:///path/to/myrepo
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///path/to/myrepo'
svn: Berkeley DB error for filesystem '/path/to/myrepo/db' while opening environment:
svn: DB_VERSION_MISMATCH: Database environment version mismatch
svn: bdb: Program version 4.6 doesn't match environment version 4.4

A quick search revealed that this is bug #342508, a solution is/was supposedly mentioned in /usr/share/doc/subversion/README.db4.3 (which does no longer exist in the Debian unstable package). Luckily this blogpost has some details.

So, the short HOWTO for upgrading an svn repository of one Berkeley DB version to another one is:

$ cd /path/to/myrepo/db
$ db4.4_checkpoint -1
$ db4.4_recover
$ db4.4_archive
$ svnlook youngest ..
$ db4.6_archive -d

In this case I upgraded from 4.4 to 4.6 (do "apt-get install db4.4-util db4.6-util" if necessary).

While I was at it, I also switched the repository to the fsfs format then:

$ svnadmin dump /path/to/myrepo > myrepo.dump
$ mv /path/to/myrepo /path/to/myrepo.bak
$ svnadmin create --fs-type fsfs /path/to/myrepo
$ svnadmin load /path/to/myrepo < myrepo.dump

Maybe this is helpful for some other people out there.

Trac - web-based project management with wiki + bug-tracker + svn code browser

Trac screenshot

I've started looking at Trac recently, a nice web-based project management tool written in Python.

It integrates with existing Subversion repositories; for example, you can browse the code in your repositories with Trac (it'll be displayed syntax-highlighted), view diffs between revisions etc. etc. Additionally, you get a wiki (e.g. for project documentation), as well as a built-in bug-tracker a la Bugzilla, all integrated nicely into a single piece of software...

It's Free Software, of course (the license changed from GPL to revised BSD somewhat recently)...

A few words on the installation:

  • First, install Trac, e.g. via apt-get install trac.
  • Then create a so-called Trac environment with trac-admin /path/to/environment/myproject initenv. You'll be asked where your svn repository resides, what's the name of the project etc.
  • You can then edit /path/to/environment/myproject/conf/trac.ini, and change the header logo/URL, the default component/priority/issue-owner and more.
  • For more administration, I recommend using the interactive Trac shell via trac-admin /path/to/environment/myproject. Type "help" for um... help.
  • Read the docs for how to setup the web server in order to run Trac (you can use CGI, FastCGI, or mod_python).

So far I've set up ca. 7-8 Trac instances for various projects and I'm quite happy with it. While I was at it, I also created a tiny Trac article in the German Wikipedia.

You can get tons of useful plugins and macros over at for additional functionality, e.g. DoxygenPlugin, GanttPlugin, DebianBtsMacro, and many more.

Karl Fogel - Producing Open Source Software

Late at night an no time for reading, but this sounds like a good candidate for the next few days:

Producing Open Source Software by Karl Fogel of CVS and Subversion fame. The book is freely available (e.g. in HTML, PDF, or dead tree format) and licensed under the terms of the Creative Commons Attribution-ShareAlike 1.0 license. Thanks Karl!

(via Roland Tanglao)

Subversion 1.2rc1 released

Subversion 1.2 Release Candicate 1 has been released. According to the release notes, there's some really interesting new stuff. E.g. a locking feature (a.k.a. reserved checkouts), a faster xdelta binary-differencing algorithm (instead of vdelta), FSFS repositories are now the default, and the usual bugfixes.

Regarding the xdelta: dumping and reloading your repositories will convert them to xdelta and make them a bit larger, but will also make operations such as svn co, svn up and svn diff a lot faster, which is great.

(via Ron Bieber)

Keeping Your Life in Subversion

Joey Hess, a fellow Debian developer, keeps his life in subversion:

For the past five years, I've checked every file I've created and worked on, every email I've sent or received, and every config file I've tweaked into revision control.

He has done this for an even longer time using CVS (see his other article "CVS homedir") and explains the advantages of using SVN over CVS. He successfully converted his CVS repositories to SVN and they now amount to several gigabytes of content.

I'm quite impressed with this, and - having already used SVN for several code projects - decided to use it for my homedir now, too. Today, I checked in my .bashrc, .bash_logout, .bash_profile, .procmailrc, .muttrc, .slrnrc, .xsession, .vimrc, .signature and a few other files into SVN, more will follow later.

Also, quite important for me, my local .todo file (currently a 130 KB plain-text file with more or less important TODO items) is now in SVN. I imagine I'll have a lot of fun when I browse the history of my .todo file in a few years ;-)

One thing I already have in SVN for quite some time is my websites. Before uploading any file (via FTP, scp, whatever) I check it in on my local computer. As most of my sites are database-driven (using wikis or CMSes), I also periodically get the database dumps and check them into SVN.
This provides me with the additional benefit, that I can test any changes to my websites on my local computer, before they become public. If I mess up, I can always restart with a simple rm -rf foo && svn up foo.

For the future I plan to also put my /etc directory as well as the /etc of my server(s) into version control.

Syndicate content