Mailbox backup from CLI Zimbra
Create a directory where you want to take backup
# chmod 777 /backup
or,
#chown zimbra.zimbra /backup
Login from zimbra user and run below command to Export/Backup user mailbox
Export/backup Zimbra mailbox
#su - zimbra
$ zmmailbox -z -m user@example.com getRestURL "//?fmt=tgz" > /backup/user@example.com.tar.gz
Restore/Import Zimbra Mailbox backup
$ zmmailbox -z -m user@example.com postRestURL "//?fmt=tgz&resolve=reset" /backup/user@example.com.tar.gz
Note: You can change username and backup location as per your setup .
Create a directory where you want to take backup
# chmod 777 /backup
or,
#chown zimbra.zimbra /backup
Login from zimbra user and run below command to Export/Backup user mailbox
Export/backup Zimbra mailbox
#su - zimbra
$ zmmailbox -z -m user@example.com getRestURL "//?fmt=tgz" > /backup/user@example.com.tar.gz
Restore/Import Zimbra Mailbox backup
$ zmmailbox -z -m user@example.com postRestURL "//?fmt=tgz&resolve=reset" /backup/user@example.com.tar.gz
Note: You can change username and backup location as per your setup .
Hi, I use this command as zimbra:
ReplyDeletezmmailbox -z -m user@example.com getRestURL "//?fmt=tgz" > /backup/user@example.com.tar.gz
but i get error ERROR: zclient.IO_ERROR (invoke Connection refused, server: localhost) (cause: java.net.ConnectException Connection refused)
Thanks & Best Regards,
Syarbel Budiman
It's seems like you mailbox or other service stopped on Zimbra Mail server. Could you please check the service status from command: zmcontrol status
ReplyDeleteAll services should run on server if anyone is stopped, start service using command: zmcontrol restart
Please tell me, how to take zimbra backup with "from" and "to" date mentioned. ie I need to backup 01/07/2020 to 31/07/2020 mail data using command.
ReplyDeleteThis is very helpful, thank you. There is one question thought, can create a backup from different version of zimbra and then restore to a newly installed zimbra. Lets say like creating a backup from mailbox contained on zimbra 8.5 and using the restore method to put the new zimbra 8.8? (and if it can be done, does the account user password also follows? (im planning on upgrade my version of zimbra, but i want to retain all those user's setting and credentials).
ReplyDeleteThanks in advance
ReplyDelete