Automatic database coversion script anyone?

Bron Gondwana brong at
Fri Apr 1 12:24:28 EDT 2011

On Fri, 1 Apr 2011 16:48:55 +0200
Ondřej Surý <ondrej at> wrote:

> Hi,
> with recent (kinda accidental) upload of 2.4 to debian unstable the
> need for automatic conversion from older database format (2.2) to the
> new one (2.4) yet again arised. Anyone already has something written
> or is willing to help write one?

The problem is berkeley db files - which is a big problem, because you
actually have to dump with the OLD package - regardless of what version
of Cyrus you have.  It's the BDB library that's the issue.

Otherwise, Cyrus 2.4 should automatically upgrade every other database
format on first access.

I really, really wanted to have BDB able to handle in-place upgrades
as well, but I haven't been able to figure out a way.  There is an
->upgrade method on databases, but it says it's destructive and can
fail - so you can't just run it during the startup process and hope...
unless you take a backup first!

Eventually my goal is that you can change the DB type in imapd.conf
and restart Cyrus, and it will just work.  We're nearly there - it
will automatically convert between types (by reading the magic from
the top of the file) - but it just can't upgrade BDB.  Answer that
question, and I can give you a 2.4.x release that upgrades magically!


More information about the Cyrus-devel mailing list