Debo-Notes: Difference between revisions

No edit summary
Line 3: Line 3:
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
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) Mark user@example.com  status as 'Maintenance' as below:
1) Export user@example.com with zmmailbox:
 
zmprov -l ma user@example.com zimbraAccountStatus maintenance
 
 
2) 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
zmmailbox -z -m user@example.com getRestURL "//?fmt=tgz&query=is:anywhere" >/opt/zimbra/backup/user@example.com.tgz




3) Change account setting as below:
2) Change account setting as below:


zmprov -l ma user@example.com zimbraMailHost mail2.example.com
zmprov -l ma user@example.com zimbraMailHost mail2.example.com
Line 20: Line 15:




4) Import user@example.com.tgz to mail2.example.com with zmmailbox:
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
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




5) Mark user@example.com status as 'Active'
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
 
zmprov -l ma user@example.com zimbraAccountStatus active
 
 
6) 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.
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 6 yet. I'll post a script after I get it work for me.
I haven't written a script for step 4 yet. I'll post a script after I get it work for me.

Revision as of 15:36, 29 April 2010

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