Saturday, November 03, 2012

Details of Migrating Zimbra 6 to Zimbra 8

I have a small Zimbra system that needed to be migrated from 6.0 to 8.0. Generally:
  1. You must update to 6.0.16 on the source system. The account export functionality is broken in versions prior to 6.0.15 and will fail on some accounts.
  2. Start with a fresh 8.0 install. On a small system (dozens of users), that seems like the simplest option.
  3. Keep the 6.0 system running.
Use the migration wizard in 8.0's admin console (Tools & Migration -> Account Migration) to move over account records only.
  1. Set "type of mail server" to Zimbra Collaboration Suite. Set "would you like to import mail" to No.
  2. Import from another Zimbra LDAP directory.
  3. Set the LDAP Search Base to "dc=foo,dc=com" where would be your domain.
This saves work on manually moving accounts between systems.

To move account contents and filter settings between servers, you can do the following on the source server:

su - zimbra      # account to move
DEST=root@destination  # ssh account on the destination server
zmmailbox -z -m $ACCT getRestURL '//?fmt=tgz' | ssh $DEST "su - zimbra -c 'cat > /tmp/acct'"
ssh $DEST su - zimbra -c 'zmmailbox -z -m $ACCT postRestURL "//?fmt=tar&resolve=reset" /tmp/acct'
zmmailbox -z -m $ACCT gfrl | awk '{print "afrl " $0}' | ssh $DEST "su - zimbra -c 'zmmailbox -z -m $ACCT'"

The size of a post request is by default limited to 1GB. You may want to increase it like so:

zmlocalconfig -e rest_request_max_upload_size=$((1024*1024*1024*4))

That's about it.