Customer-initiated Zimbra Account Backups

From XMission Wiki
(Redirected from Customer-initiated Backups)
Jump to: navigation, search

Customers can backup their own Zimbra mailbox by exporting it to a .tgz archive. This functionality is accessible through the Zimbra Web Interface in "Import/Export" under "Preferences". However, these backups can also be made through REST requests, either manually through a browser, or automated with a utility such as wget.

Here is the URL format for a REST request to backup an entire mailbox:

https://zimbra.xmission.com/user/account@domain.com/?fmt=tgz

It does require authentication, and standard http authentication can be used. If you type the above URL in your browser (replacing the account name with your own), it should ask you for your Zimbra username and password. Enter that, and the file it saves will be the .tgz archive file for your account.

This can be automated with tools such as wget or curl. Here is an example with wget:

wget --no-check-certificate --auth-no-challenge --http-user account@domain.com \
--http-passwd password 'https://zimbra.xmission.com/user/account@domain.com/?fmt=tgz' \
-O acctbkp.tar.gz

This will automatically save the account backup to acctbkp.tar.gz in the current directory. --no-check-certificate is to compensate for a lack of certain CA certificates on some systems, and --auth-no-challenge is to force authentication.

To automate backups (on a UNIX-like system), one could cron a the above command, and use backticks to insert the date into the filename.

wget -nv --no-check-certificate --auth-no-challenge --http-user account@domain.com \
--http-passwd password 'https://zimbra.xmission.com/user/account@domain.com/?fmt=tgz' \
-O /backups/account_domain_`date +%Y%m%d`.tar.gz 2>&1 | egrep ERROR