Backing up Zimbra

Im not sure if its the correct place to post this, but restic is the best backup system i have seen. I would like to see if its possible to put a bounty (price) to maybe see that its possible to backup zimbra mail boxes only. From what i seen is that zimbra stores its messages in


Which unfortunately it does not store it somewhat organized like maildir format

Well if someone is interested im glad to help

Thank you

Sorry, but what is the actual question? Are you asking how to back up Zimbra mail stores? I imagine that’s done by just identifying where Zimbra stores its mailboxes and then backing up that/those folders?

Thanks for the reply, haven’t tried it yet but could restic backup the folder store? it wouldn’t have any problems
im going to try it out later but wanted to see if someone else has accomplish it

If it’s files and directories in a filesystem that restic can read, then yes it can back it up.

1 Like

so i was trying it seems to work but what does not work is the restore for zimbra. restic can restore the msg but it wont appear on zimbra

Sorry, but that’s out of restic’s control, you’ll have to ask the Zimbra folks about that :slight_smile: Restic can only back up and restore the data, then it’s up to Zimbra to actually make use of that restored data. Perhaps you need to back up some other files or a database as well.

That seems to be the case:

Looks like the files themselves are nigh unusable without the database to index them.


Zimbra has its own backup process, that safely exports everything necessary to a folder structure. Looking at the backup directory structure it seems like the Zimbra folks paid attention and made sure that files are not overwritten unnecessarily and that the things that change seem to do so using serial writes (for example database logs are kept in files that are just added to and not modified entirely.

I think that if Restic is given the Zimbra backup folder (by defailt /opt/zimbra/backup) as a source location, it will efficiently back Zimbra up.

Also, Zimbra seems to have command line utilities that initiate a backup. It looks like it will be easy to integrate Zimbra and Restic to run sequentially from the same script so that Restic runs after every Zimbra backup run.

I don’t use Zimbra myself so I didn’t verify it.

If you’re only interested in the mailboxes, perhaps it’s possible to exclude other things. However, I would urge you to back up the entire Zimbra backup folder, because then you can use Zimbra’s own tools to restore specific accounts.

Hope that helps.

Thanks for the reply, correct i checked many ways to backup zimbra like zmbackup, and other scripts but they all fail in the way it does its backup compared to restic, lets say zmbackup it backups full the first time like restic but every week i have to do a full which is not logical because if i have mailboxes of 50 gigs and around 10 or more takes way to long, as lets say all the email of the 50 gigs disappears or the users purposely deletes it, i would have to grab the full backup of that week then the incremental it makes in format tgz, so in theory i cannot delete any incremental backup until i have created another after that week. while in restic it does only 1 time full backup then it does it differential and never again the full backup, and something happened to me that a user (accidentally) deleted all their inbox on outlook and restic restored 21 gigs of it (on a postfix server)

currently still looking at the way of the restore on zimbra which only found this to restore 1 msg at a time

/opt/zimbra/bin/zmmailbox -z -m am --noValidation /Inbox /media/bakszimbra/0/838-5657.msg

1 Like

@farzadha2 thanks for the reply, i also saw your forum post about Future Backup for zimbra?
which i havent try zmbackup yet but after seeing that post didnt try it which i thought maybe on restic would work, that command only works for msg? not the whole folder?