To those whom may be concerned by such a migration... I'm gonna give here a few hints to avoid, or fix, a potential Cyrus-Imap crash while upgrading from Debian lenny to Squeeze.
What is the configuration I'm talking about?
Debian Lenny, fully patched except Cyrus, which packages had been kept back (ie: no automatic update of Cyrus with APT), to be more accurate:
- cyrus-common-2.2 2.2.13-14+lenny3 (to be upgraded to: 2.2.13-19+squeeze1)
- Cyrus Imap Berkeley DB 4.2 (to be upgraded to: 4.7)
First, a good read, for general culture regarding Cyrus Imap:
Then Isuggest you to read this, it may help you if you are using or upgrading from a particular version of Cyrus:
They often say that Cyrus' index files need to be reconstructed. This will be important later on.
In fact, here is the bug you may face while upgrading from Cyrus Lenny to Cyrus Squeeze:
Warning: this may also happen even if you did select the main Cyrus packages to be kept back in APT! Cyrus-Imap may not restart after global Squeeze upgrade!
As you can see, there is a problem that is not said to be fixed before the future Debian stable!
You may try the script they gave, but it did not really helped me out.
After all of that, Step 0:
- Check that there is no imapd process still running, even if you used /etc/init.d/cyrus2.2 stop !
- check what version of Cyrus libs you are using: ldd /usr/sbin/ctl_mboxlist
Update the db4.x_util tool, accordingly, with APT.
- check what file format of cyrus mailboxes.db file you have: file mailboxes.db
It has to be coherent with the Cyrus' conf files. Change the conf files accordingly, if needed.
- compare the version of Cyrus components/database :
diff /usr/lib/cyrus/cyrus-db-types.active /usr/lib/cyrus/cyrus-db-types.txt
If there are differences, update the file types.active with the new settings (from types.txt).
- backup, then move/delete Cyrus db files, generaly located in /var/lib/cyrus (mailboxes.db, recover.db, ...)
- check that you have the last version of Cyrus Imap: apt-show-versions cyrus2.2
start Cyrus! and watch it rebuilding its working folder, and the most important file: mailboxes.db...
Hope this helps.
Last, in case of, I suggest you to read: http://www.gradstein.info/software/how-to-recover-from-cyrus-when-you-have-some-db-errors/