How to migrate 32-bit Cyrus IMAPD mailboxes to 64-bit

Thanks to Viktor Petersson’s blog for the crucial hints. I adapted his procedure for FreeBSD slightly because I was moving the cyrus-imapd service from an old 32-bit SuSE Linux Enterprise Server version 9 (SLES9) to a new 64-bit server running CentOS 5.5.

On old server,

rsync -aP /var/lib/imap root@mynewserver:/var/lib/imap
rsync -aP /var/spool/imap root@mynewserver:/var/spool/imap

Stop Cyrus service on both old and new servers.

rsync -aP --delete /var/lib/imap root@mynewserver:/var/lib/imap
rsync -aP --delete /var/spool/imap root@mynewserver:/var/spool/imap
sudo -u cyrus /usr/local/cyrus/bin/ctl_mboxlist -d > ~/mboxlist.txt

Copy mboxlist.txt to new server.

On the new server,

sudo -u cyrus rm /var/lib/imap/db/* \
/var/lib/imap/db.backup1/* \
/var/lib/imap/db.backup2/* \
/var/lib/imap/deliver.db \
/var/lib/imap/tls_sessions.db \
/var/lib/imap/mailboxes.db
sudo -u cyrus /usr/lib/cyrus-imapd/ctl_mboxlist -u < ~/mboxlist.txt
sudo -u cyrus /usr/lib/cyrus-imapd/ctl_cyrusdb -r
sudo -u cyrus /usr/lib/cyrus-imapd/tls_prune
sudo -u cyrus /usr/lib/cyrus-imapd/ctl_cyrusdb -c
sudo -u cyrus /usr/lib/cyrus-imapd/cyr_expire -E 3
sudo -u cyrus mkdir /var/lib/imap/rpm/
cd /var/spool/imap/users
for U in * ; do 
  sudo -u cyrus /usr/lib/cyrus-imapd/reconstruct -r -f "user.$U"; 
done

Start the service on the new server.

Advertisement

3 Responses to “How to migrate 32-bit Cyrus IMAPD mailboxes to 64-bit”

  1. Dmitry Says:

    Have you solved the problem you mentioned here:
    http://www.spinics.net/lists/info-cyrus/msg12768.html
    ?

    • cynici Says:

      Sorry for this tardy reply. I’m on vacation. Will try to look at the open issue when I get back in 2 weeks’ time.

    • cynici Says:

      From this forum post, the seen state may become available for copying through
      mboxconfig sharedseen true (requires version 2.3.9+)

      I have not tried it myself because my setup does not have any public folder. HTH.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.