Automatic database coversion script anyone?
brong at fastmail.fm
Sun Apr 17 13:55:42 EDT 2011
On Tue, Apr 05, 2011 at 02:58:12AM +0200, Ondřej Surý wrote:
> You cannot backup (using DB_ENV->archive) before you upgrade, but if
> you find a way how to call (backend)->init with CYRUSDB_UPGRADE flag
> and them (backend)->open with same flag, the attached patch should do
> the trick. (But I advise to review the patch - it's 3AM here...)
+ r = db-close(db, 0);
Yes, review would be good :)
Apart from little syntax nitpicks though - the concept looks good.
One question: we can't tell easily if the DB is an old version I
don't think. Would it make more sense to try to open it without
the upgrade flag first, and only if that fails to do the upgrade?
I'm thinking it would be good in that case to copy the file to a
temporary location and upgrade the temporary DB, then close it and
copy it back if the upgrade succeeds.
More information about the Cyrus-devel