cyrus imapd
Migration from 2.0.16 to 2.2 / 2.3
main-documentation: http://cyrusimap.web.cmu.edu/imapd/install-upgrade.html
install the new cyrus on the new machine
I used the standard-packages of my ubuntu and then changed the folder-locations and enabled ldap-support. Then I tested the new installation to be sure that everything is working.
migrate all the files
I used rsync to copy all the files from the old machine to the new machine. Including the config-section !!
Note that old directory-structure is ..../spool/user while new one is .../spool/mail/user
use rehash
rehash is only necessary if you have hashimapspool* enabled in your imapd.conf which is only recommended for large installations. If you dont have this enabled, just skip this section. If you have, you are in trouble, cause:
DO NOT USE REHASH
rehash messed up the whole thing and did not do at all, what is was supposed to do. It messed with upper- and lowercase, it put the wrong user in the wrong directories and so on. There are several reports in the web about people having their system messed up with rehash, so i wonder why its still recommended in the docs. do not use it !!
if you want to use it : there are two problems I had to solve before rehash was able to run and mess up:
* I had old core-files in config/user/*/ or other files that dont belong there. (details see http://www.goldfisch.at/knowledge/366)
* rehash -i -f full helped me a lot cause it explains what is doing and does not give up on minor errors.
Please note that rehash is a perl-script. So on small errors you might want to look to add into the source and add a few debugging-improvements or make it more error-tolerate :)
I changed it a lot on my first migration and spent several hours on dirty coding so on my next migration I just didnt use hashed directories any more.
==== convert the mailboxes.db ====
Converting mailboxes.db prooved to be the most difficult part. cvt_cyrusdb could not convert the old mailbox-file to the new skiplist-format. (although this is the official migration-recommendation).
cvt_cyrusdb fails on the mailboxes.db with : “can’t open old database”.
solution** : on the old machine use “ctl_mboxlist -d” to dump the mailboxes.db to a flat-file and then on the new machine use cvt_cyrusdb to convert from flat to skiplist
It seems that on my old machine there is a different berkeley-format than on my new machine and I was recommended to use some berkeley-tools to convert before trying cvt_cyrusdb again. I always get confused with berekeley-stuff and did not manage.
So what I did was:
- user ctl_mboxlist -d on the old machine to get a plain-mailbox-file
- backup the config/db folder on the new machine and create an empty new one
- create an tempty mailboxes.db in the config/ - folder
- use ctl_mboxlist -u < mailboxes.plain to import the old mailbox-file
- check the new mailboxes.db-files (binary !!) if it says skiplist at the very beginning
Note that my new cyrus could *not* handle the old mailboxes.db-file. Also note that the plain-file exported with ctl_mboxlist is not the flat-format, but simply a plain-format. If you use cvt_cyrusdb on the plainfile and telling that its a flat-format no error will occure. But cyrus-imap will later fail with serios DB-Errors.
Always monitor the log-files (syslog in my case) cause it gives valueable additional information. you can also start ‘cyrmaster -D’ to let it put information to STDOUT which is not as detailed, but also very important information.
convert the seen-files
here the recommended solution with cvt_cyrusdb worked perfectely. Please note that seen-files appear in the config and the spool-partition, so be sure to convert the files in both branches.
find /data/cyrus -name \*.seen -exec /usr/sbin/cvt_cyrusdb \{\} flat \{\}.new skiplist \; -exec mv \{\}.new \{\} \;



