Its not very difficult but make sure the mail service is turned off while you do this. All you need to do is copy /var/spool/imap from the old drive to the new one (mailboxes for all users). The old drive is no longer needed. Make sure ‘cyrusimap’ is the owner when you are done copying (sudo chown -R cyrusimap:mail /var/spool/imap). Next, remove the mail database directory, if it exists (sudo rm -rf /var/mail) and make a new one (sudo mkdir /var/mail). Initiaize a new mail database (sudo /usr/bin/cyrus/tools/mkimap). You need to fix the owner for that as well (sudo chown -R cyrusimap:mail /var/mail). Now you are ready to rebuild the database from the copied mailboxes (sudo /usr/bin/cyrus/bin/reconstruct -i). Piece of cake.
Note that this assumes your database location is set to /var/mail/imap and the mail store location is set to /var/spool/imap using server admin. If you put them somewhere else you need to change the above accordingly.
Comments are closed