Zimbra Backup real world experiences?

Hey there,

I tried my luck on Reddit, but seems the people aren’t really alive there, so trying here too :wink:
So, I’m new to Zimbra, (a customer choosed that to migrate from ispconfig) and I’m wondering if I can backup the Blobs (so the mailboxes backup as I understand) on external storage (network mount, NFS/samba/[name your devil here]), and the metadata locally.

Zimbra support told me " this is what’s supported : " referring me to the doc, which wasn’t really helpful.

As we know, the real world tend to be different, and with an expected mail storage size of ~10T , backing up locally doesn’t really makes sense, and I would need to move that afterwards anyway.

Any real life experiences ?

I haven’t seen zimbra in almost 7 years and I wasn’t the one managing or backing it up back then, so I wouldn’t call it “real world.”

https://wiki.zimbra.com/wiki/Backing_up_and_restoring_Zimbra_(Open_Source_Version)#Another_option

The wiki is pretty straight forward. As root:

su - zimbra -c "zmcontrol stop"
pkill zimbra
rsync -varoglAX /path/to/zimbra /path/to/nfs
su - zimbra -c "zmcontrol start"

If you use zfs (or any other file system with snapshot capability) you can get lower down-times:

su - zimbra -c "zmcontrol stop"
pkill zimbra
zfs snapshot -r tank/path/zimbra@20240415
su - zimbra -c "zmcontrol start"
zfs send -v tank/path/zimbra@20240415 | ssh root@backup-server "zfs receive -s tank2/path/zimbra

For incremental zfs send:

zfs send -v -i tank/path/zimbra@20240410 tank/path/zimbra@20240415 | ssh root@backup-server "zfs receive -s tank2/path/zimbra
1 Like

Hey thanks for that sets of small scripts ! I’ll check if my colleagues stumbled on them too.

But I was probably unclear on what I’m trying to fix : My problem nowadays is that the mailboxes aren’t stored in a maildir format, so I understand the storage is a bunch of directories with assorted mails from different user. I cannot afford to restore the full mail server to some temporary location to go and restore some mails in a user mailbox when they screw up (and boy they do).

There is however a tool that will create a " backup " (and incremental one) of the mailbox in a zip format. Zimbra told us that we need to use that tool directly on a storage attached to the server.

As mentioned, I’ll have around 10T for 400 mailboxes with some users with 200G mailboxes (yeah I know, don’t mention that, we are already in pain with the current setup).

In the end, I think I’ll just use a storage in the same rack with a NFS/ZFS storage for that part, before backing up my snapshots away.

Thanks for the links anyhow ! :slight_smile:

Looking at the same link, there’s some scripts there, at the bottom. Check out the 2nd script, zimbraBackupAllAccounts.sh. When you’re backing up the whole of zimbra, you’re also backing up user mailboxes.

To restore just a single user mailbox, you grab the zimbra home mailbox directory and copy the mailbox associated to a user to the zimbra server to a local path on the zimbra server. Then look at script 4, zimbra_restore_allaccounts.sh.

You invoke zmprov -l gaa to show you the users, then you call upon zmmailbox with the proper user name and the source path (the temp location of the zip) to restore the data.

Note that zmmailbox is actually exporting each user’s mailbox from the output of zmprov -l gaa, meaning that if one user’s mailbox is screwed, you can just restore their own mailbox, without touching the ones from other users.

You can have a staging zimbra server where you restore mails to, then save the mail, or forward the mail to the users that deleted them. This also kind of works as a test to see if restores actually work, so you could use the staging server for DR RTO testing.

1 Like

I stumbled on that zimbrabackupallaccounts.sh also, but didn’t digged to far one what was doable. I guess I’ll have to try doing that in a way that isn’t officially supported by Zimbra, aka having a remote storage that’s looking like a local one to my host (my customer is paying for the licenses, however I’m having doubts on that investment at the moment).

Anyway, thanks for clearing that up, I think we have a decent solution for now.

First test report :

  • created a volume on a truenas machine, mounted it on the Zimbra store. NFS via 10G port (vlan interfaces, Proxmox host on the Zimbra side)
  • 1 part of backup has been run, 5 mailboxes only.
  • waiting for a full week of run to validate the results. Will report our results along the way.

So, a bit of a report on our progress :

  • My understanding is that zmmailbox is not making sense. My understanding is that the tool requests the dump of the mailbox via a rest API, and starts a IMAP session locally . This sounds like … a silly amount of layers for a backup.
  • On the storage front, we just ensured we had enough temp space locally, and used a script to backup a defined set of mailbox to the external storage. Our script created a file locally and move it to the NFS / ZFS storage. No issue, this part worked perfectly.
  • We backed up ~15 mailboxes, ranging from 100M to 70G, took roughly 2-3 hours, with an absolutely not optimized storage. Our bottleneck seems to be the zmmailbox requesting a bunch of other processes.

Seems I stepped into a terrible rabbit hole I wanted to avoid :wink: