How to Backup and Restore Email in Zimbra

Quick steps to create backup and restore in zimbra email server. 

Email administrator was requested to perform backup and restore without login to user, meaning the backup and restore task should be perform via command line using zmmailbox command. 

Kindly refer to below steps :

1. Make sure you have root access to zimbra email system and the backup destination should be writeable by zimbra user. Create /backup and assign permission to zimbra user and group :
[root@amitmaheshwari.in ~]# mkdir /backup
[root@mail-server ~]# chown -R zimbra:zimbra /backup

2. As a zimbra user, issue the following command to backup the user mailbox :
[root@amitmaheshwari.in~]# su - zimbra
[zimbra@mail-server ~]$ zmmailbox -z -m user1@amitmaheshwari.in getRestURL "//?fmt=tgz" > /backup/user1@amitmaheshwari.in.tar.gz

3. As a zimbra user, issue the following command to restore the user mailbox :
[root@amitmaheshwari.in~]# su - zimbra
[zimbra@amitmaheshwari.in ~]$ zmmailbox -z -m user1@amitmaheshwari.in postRestURL "//?fmt=tgz" > /backup/user1@amitmaheshwari.in.tar.gz

Note : Please note that this will backup mailbox content only without user preferences.