Zimbra Account Export / Import
https://wiki.zimbra.com/wiki/Zmmailbox#Export.2Fimport_an_entire_account
On the Zimbra where we will export our account FROM:
$ dzdo -iu zimbra
[zimbra@tmbdevmbx2 ~]$ /opt/zimbra/bin/zmmailbox -z -m nils@tmbdevmbx2.turkcell.tgc -t 0 getRestURL “//?fmt=tgz” > /tmp/account.tgz
On the Zimbra where we will import our account TO:
You need to add your “domain” and after that, you need to create the same account here.
Later, we transfer “account.tgz” file to our Zimbra on Vagrant. We run “Import” command. Whichever store manager we are using (we may be using our own via an extension, you can see my post here), mail files are transported via it.
➜ CentOSZimbra3 vagrant scp /Users/senoritadev/Downloads/account.tgz .chmod 777 account.tgz[vagrant@zimbrathree ~]$ sudo cp account.tgz /opt/zimbrasudo -u zimbra /opt/zimbra/bin/zmmailbox -z -m nils@tmbdevmbx2.turkcell.tgc -t 0 postRestURL “//?fmt=tgz&resolve=reset” /opt/zimbra/account.tgz
Import command calls “saveCallback” method which is in https://github.com/Zimbra/zm-mailbox/blob/develop/store/src/java/com/zimbra/cs/service/formatter/ArchiveFormatter.java. From here, “addItem” method is entered and then, StoreManager code is executed after “Mailbox.addMessage” is called.
Happy Coding!