I’ll be logged in as root. If you have lockou or closed mailbox you can not export the mailbox content. You have to check mailbox status.
Step 1 – Login as Zimbra.
Export Script
Step 2 – Create file in which I will include the script for export .
Step 3 – Make this file exeutable.
Step 4 – Create file in which the script will save retrieve date.
Step 5 – Open this file with the following command.
Step 6 – I will include mu script. The script retrieve all mailbox and all domain and save in this file /opt/zimbra/backup/users.list then will save content of all mailbox include in this list.
for account in `cat /opt/zimbra/backup/users.list` ;
do
echo “Processing ${account} …”
/opt/zimbra/bin/zmmailbox -z -m $account getRestURL ‘/?fmt=tgz’ > /opt/zimbra/backup/$account.tgz
done
Copy export mailbox content to new server with rsync. It’s best way.
Step 7 – On the new server you have to set full permission on folder in you which save mailbox content. Execute the following command.
Step 8 – Execute the following command from your old server. Rsync work on port 22 but I will use diferent port, I will use port 2222. The ip address of my new server is 192.168.0.190. You have to root user for new user.
Import Script – if you don’t have the all account from old server on your new server you have to read ‘Export and import account’ section below
Step 9 – You have to full permission on the folder in which you will save files.
Step 10 – Create file in which I will include the script for import.
Step 11 – Make this file exeutable.
Step 12 – Create file in which the script will save retrieve date.
Step 13 – Open this file with the following command.
Step 14 – I will include mu script. The script retrieve all mailbox and all domain and save in this file /opt/zimbra/backup/users.listthen will import all content of all mailbox in this list.
for account in `cat /opt/zimbra/backup/users.list` ;
do
echo “Processing ${account} …”
/opt/zimbra/bin/zmmailbox -z -m $account postRestURL “/?fmt=tgz&resolve=modify” /opt/zimbra/backup/$account.tgz
done
Export and import account – From new server you have to connect to old server and retrieve mail account
Step 15 – On old server as Zimbra user execute the following command and retrieve password which you need later.
Step 16 – Click Migration wizard.

Step 17

Step 18 – Import from another Zimbra LDAP directory

Step 19 – Set same password for all new accounts. For SMTP Host set ip address on your old server

Step 20 – Bind password – include password which you retrieve above. For dc write name of your domain. For example linux-sys-adm.

Step 21

Step 22

Step 23 – Select account to import

Step 24 – Click search button.

Step 25 – Click add all button.

Step 26 – Use admin user and password from your old server.

Step 27

Step 28 – Click Finish button.

17 Theme – How to configure apache2 and Zimbra together/same host on Ubuntu (Server) 14.04 LTS Step-by-Step