Debo-Notes

Mailbox Move (Open Source Edition)

As an example, we have a two server setup mail1.example.com & mail2.example.com. One should be able to move user@example.com from mail1.example.com to mail2.example.com as below. In the following steps, all commands are executed on mail1.example.com

1) Export user@example.com with zmmailbox:

zmmailbox -z -m user@example.com getRestURL "//?fmt=tgz&query=is:anywhere" >/opt/zimbra/backup/user@example.com.tgz


2) Change account setting as below:

zmprov -l ma user@example.com zimbraMailHost mail2.example.com

zmprov -l ma user@example.com zimbraMailTransport lmtp:mail2.example.com:7025


3) Import user@example.com.tgz to mail2.example.com with zmmailbox:

zmmailbox -u https://mail2.example.com:7071 -a admin@example.com -p yourpasswd -m user@example.com postRestURL "//?fmt=tgz&resolve=reset" /opt/zimbra/backup/user@example.com.tgz


4) Delete user@example.com MySQL records, also delete /opt/zimbra/store/0/$mailbox_id, /opt/zimbra/index/0/$mailbox_id. $mailbox_id can be found in MySQL table zimbra.mailbox


Please note after this move share references to user@example.com folders won't work, which means user@example.com will have to share his folders to others again.


I haven't written a script for step 4 yet. I'll post a script after I get it work for me.

Jump to: navigation, search