Peer review for backup plan

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
tonyg
Advanced member
Advanced member
Posts: 51
Joined: Fri Mar 16, 2018 5:25 pm
Location: USA
ZCS/ZD Version: 8.8.12.GA.3794.UBUNTU18.64 FOSS
Contact:

Peer review for backup plan

Post by tonyg »

My current backup of Zimbra is initiated from another system on my network. It uses rsync to reach into the Zimbra server and retrieve the /opt/zimbra tree.

Question 1:
For zimbra, what else should be saved?
Cron settings?
Anything for the HTTP server?
Anything else outside of that file system?

The standard rsync attempts to copy the ldap data.mdb, which is sparse and defaults to 80G.
That can be compressed with tar locally, and the rsync can then skip that one file and just get the small tarball:
time tar Scf data.mdb.tar
That takes 3+ minutes. Disadvantages of rsyncing the tarball: First, it requires a cron process on the Zimbra server to occasionally generate a tarball. Second, on restore an extra step is required. Advantage: Very fast rsync transfer.

Another option is to use the --sparse option on rsync. A disadvantage is that this takes about 9 minutes during the live transfer. Advantages: The sparse file is transferred, not a compressed file that would need to be decompressed during recovery. No extra step to tar.

Question 2: (can be observed with experimentation but I'll ask)
Does anyone know if rsync will only pull over the incremental changes of a sparse file like this? Or does it detect that the file has changed in some way and then pull over the entire file?

Another option, similar to tar would be to use zmslapcat, which leaves a compressed ldap.bak And a timestamped copy. These can be used to recover with slapadd. (Ref to Syslint)

Question 3:
My preference is to let rsync do everything there. I'll probably split rsync commands to get data.mdb separately from everything else. But does anyone have a suggestion to do any of this differently?

Thanks!
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Peer review for backup plan

Post by JDunphy »

An optimization would be to verify the integrity and not pull on db error until you could look into it. Default check is once per week and email only on error.

Code: Select all

# Do not sync if we an an internal corrupted database table
su zimbra -c "/opt/zimbra/libexec/zmdbintegrityreport -m"
if [ $? == 1 ]; then
   echo  "Corrupt DB - stopping"
   exit 
fi
User avatar
axslingr
Outstanding Member
Outstanding Member
Posts: 256
Joined: Sat Sep 13, 2014 2:20 am
ZCS/ZD Version: 8.8.15.GA.3869.UBUNTU18.64 UBUNTU18

Re: Peer review for backup plan

Post by axslingr »

Here's the way I do it. I've tested a restore copying the data.mdb back manually after doing an rsync and it works perfectly.

Code: Select all

/opt/zimbra/common/bin/mdb_copy /opt/zimbra/data/ldap/mdb/db /backup/directory
rsync -avHK --delete --exclude 'data.mdb' /opt/zimbra /backup/directory/
tonyg
Advanced member
Advanced member
Posts: 51
Joined: Fri Mar 16, 2018 5:25 pm
Location: USA
ZCS/ZD Version: 8.8.12.GA.3794.UBUNTU18.64 FOSS
Contact:

Re: Peer review for backup plan

Post by tonyg »

Thanks guys.

As to my question #2 about incremental updates: Whatever is happening internally, I've observed that it takes the same amount of time to rsync --sparse whether locally or remotely.

I'll cron mdb_copy on the Zimbra system shortly before the remote system comes in to pull out the files.

So far, I'm understanding that there's nothing important to Zimbra outside of the /opt/zimbra file system. I'm telling myself there's no way that this would work, but to recover from this scenario has anyone just installed a new system, re-installed Zimbra, then just over-laid the file system, and voilà? I need to look around.

Here's some more good info for anyone else who stumbles in here:
https://zimbra.github.io/adminguide/lat ... up_methods
https://wiki.zimbra.com/wiki/Importing_ ... to_replica
http://manpages.ubuntu.com/manpages/cos ... opy.1.html
Post Reply