From Zimbra :: Wiki
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 email@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 firstname.lastname@example.org with zmmailbox:
zmmailbox -z -m email@example.com getRestURL "//?fmt=tgz&query=is:anywhere" >/firstname.lastname@example.org
2) Change account setting as below:
zmprov -l ma email@example.com zimbraMailHost mail2.example.com
zmprov -l ma firstname.lastname@example.org zimbraMailTransport lmtp:mail2.example.com:7025
3) Import email@example.com to mail2.example.com with zmmailbox:
zmmailbox -u https://mail2.example.com:7071 -a firstname.lastname@example.org -p yourpasswd -m email@example.com postRestURL "//?fmt=tgz&resolve=reset" /firstname.lastname@example.org
4) Delete email@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 firstname.lastname@example.org folders won't work, which means email@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.