Automatic database coversion script anyone?

Ondřej Surý ondrej at sury.org
Mon Apr 4 18:28:02 EDT 2011


> 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!

What if you add an option to cyrus-imapd (to all BDB users) which
would say it can do the in place upgrade. The DB_ENV->upgrade looks
like it is OK, the only problem is that you need to have backups - and
that something which can be done either by maintainer script in
postinst or by administrator - it would also help if there was a
program which could list all the databases which needs to be
converted/backuped.

If there was a such option I could easily accomplish some magick with
depending on dbX.Y-util (where X.Y is the old version of BDB) and
backup the old database and only after the backup is done (or the
users say "no" to a backup question because he has the backups already
or he doesn't care) I could run the cyrus-imapd --do-upgrade (or
cyrmaster --do-upgrade). That would satisfy both - the safety of the
databases and the need for seamless upgrade.

How does that sounds?

Ondrej
-- 
Ondřej Surý <ondrej at sury.org>


More information about the Cyrus-devel mailing list