Jump to content

Recommended Posts

Posted

I have touched on this briefly in another post BUT I need to clarify it a bit.

How do you back up zimbra?

Bear in mind that I don't know how to back up anything from a linux/ubuntu box!

I have had a squint at a couple of articles in the zimbra forums but wondered if anyone could give me some pointers?

 

Thanks

Posted

For a complete disaster-recovery option, a common method is to stop the Zimbra services, copy the entire /opt/zimbra directory to somewhere safe, and restart the services again. Restoring is just a matter of putting back the zimbra directory and resetting permissions. This is the script that I put together for the very purpose. It duplicates the directory, compresses it, and copies it to a remote NFS location.

 

Open Source Edition Backup Procedure - Zimbra :: Wiki

 

If you wanted per-mailbox backup, from what I read I think it would be possible to develop a script that uses the REST interface to fetch a Zip file of each user's inbox.

  • Thanks 1
Posted

@Webman.

Can I ask about part of the script...

 

NFSHOST="bbs-nas-001"

NFSPATH="/mnt/vol1/backups/bbs-zcs-001"

NFSMOUNT="/mnt/bbs-nas-001"

 

I'm not sure how this bit works!

 

My server is ed-prenton-cs01 which I can see would need to go into the first line.

It's the next two lines I'm not sure about.

Do I need to create a share called backups on that server?

Posted

The NFS... lines are the details of the remote backup server that is running NFS (just like Samba or FTP).

 

NFSHOST - hostname of the backup server

NFSPATH - path of the backup directory on the backup server

NFSMOUNT - local mountpoint on the zimbra server at which to mount the NFS server

 

The script itself handles the mounting and unmounting.

 

(Our zimbra server is bbs-zcs-001, backup server is bbs-nas-001)

Posted
For a complete disaster-recovery option, a common method is to stop the Zimbra services, copy the entire /opt/zimbra directory to somewhere safe, and restart the services again.

 

If your server's not in production yet, you might want to set up your data store using LVM instead of just a plain disk. That way you can do snapshots of disks, so you don't have to stop and restart services.

 

--

David Hicks

Posted
If your server's not in production yet, you might want to set up your data store using LVM instead of just a plain disk. That way you can do snapshots of disks, so you don't have to stop and restart services.

 

I agree - definitely a good idea - reading up on LVM will be worth it. I just didn't have the time or the skill to do LVM at the time.

Posted
If your server's not in production yet, you might want to set up your data store using LVM instead of just a plain disk. That way you can do snapshots of disks, so you don't have to stop and restart services.

 

--

David Hicks

 

I think you do have to stop the services, but only long enough to start the snapshot, means it's not much more than a restart and only takes a couple of minutes.

 

Live backup needs the commercial version

Posted

@Webman.

All the script runs fine with adjustments for my servers BUT my NFSknowledge is letting it down :(

 

I have set up nfs on a ,mac server as we have a 4TB drive sat doing nothing and thought that would be ideal for the back ups.

 

Can I put my error here for some help?

 

Thanks

Posted
I think you do have to stop the services, but only long enough to start the snapshot, means it's not much more than a restart and only takes a couple of minutes. Live backup needs the commercial version

 

Does Zimbra do something especially cunning or fancy with disks, then? Shurley the whole point of LVM is that LVM-managed volumes look just like any other block devices, the applications using them shouldn't be able to tell the difference. Does starting a snapshot make some noticable change to a block device? Wouldn't the block device just maybe take a couple of seconds to return from a read/write operation if it were right in the middle of setting up a snapshot?

 

--

David Hicks

Posted

@Webman

I have NFS running on my mac server, as far as I can tell. I used a third party application to set it up and if I browse to /etc/exports I can see that the nfs folder is set up in there?

 

Anyway all the script runs fine until I get to the following...

root@email:/tmp/zcsbackup#

root@email:/tmp/zcsbackup# mkdir $NFSMOUNT

root@email:/tmp/zcsbackup# mount -t nfs $NFSHOST:/$NFSPATH $NFSMOUNT

mount: wrong fs type, bad option, bad superblock on 10.60.28.53://Volumes/Promise/zimbra,

missing codepage or helper program, or other error

(for several filesystems (e.g. nfs, cifs) you might

need a /sbin/mount. helper program)

In some cases useful info is found in syslog - try

dmesg | tail or so

Like I said before I'm new to NFS so it could be somthing really simple that I have cocked up!

 

@Geoff

Rsync? please do tell, I am really a lightweight when it comes to linux and mac, which is unfortunate with us having an expensive mac server setup staring at me out of the server cab.

Posted
If your server's not in production yet, you might want to set up your data store using LVM instead of just a plain disk. That way you can do snapshots of disks, so you don't have to stop and restart services.

 

--

David Hicks

 

Do you have some more info on LVM please?

 

My mail server is just a test at the moment but I am trying to learn as I am going so when the time does come for a move I should know more than i do now, if you see what I mean?

Posted

First, the extra forward-slash could be causing the problem - so remove the on in this line:

 

mount -t nfs $NFSHOST:/$NFSPATH $NFSMOUNT

 

Secondly, ;), do you have the NFS client installed (it's not by default)? Try running the showmount command - if it doesn't work then you need to install nfs-common I believe.

 

Running this command once you have it installed should give you details of the NFS exports:

 

showmount -e 10.60.28.53

  • Thanks 1
Posted

@Webman

 

See I told you I don't get linux!

It works thanks webman. It was that nfs was not installed. Duh!

 

I now have a backup on my mac server's oversized direct attached storage.

 

Now then time to try to work out cron to automate this task. One question, it is cron I use isn't it? :D

Posted
Does Zimbra do something especially cunning or fancy with disks, then? Shurley the whole point of LVM is that LVM-managed volumes look just like any other block devices, the applications using them shouldn't be able to tell the difference. Does starting a snapshot make some noticable change to a block device? Wouldn't the block device just maybe take a couple of seconds to return from a read/write operation if it were right in the middle of setting up a snapshot?

 

--

David Hicks

 

The problem is that it will be a crash consistent state backup, if the database and services were not stopped before the snapshot. This may mean you end up with a corrupt database when using lvm.

 

The paid for version will allow online backup of the system with it's own utilities.

  • Thanks 1
Posted
Now then time to try to work out cron to automate this task. One question, it is cron I use isn't it? :D

 

Lol :)

 

In Ubuntu, to edit the superuser crontab file:

 

sudo crontab -e

 

And for our backup:

 

55 23 * * Mon-Fri   /usr/local/sbin/zmbackup.sh > /var/log/zmbackup.log 2>&1

Posted
Do you have some more info on LVM please?

 

My mail server is just a test at the moment but I am trying to learn as I am going so when the time does come for a move I should know more than i do now, if you see what I mean?

 

I would definitely encourage the use of LVM. Similar to webman, our zimbra was set up years ago when I didn't eppreciate the advantages of LVM. Now I set up all servers on our SAN using LVM. THere is a thourough guide (for RHEL/Centos) here: LVM Administrator's Guide The conecpts and CLI will apply to ubuntu if the gui doesn't.

  • Thanks 2
Posted
Do you have some more info on LVM please?

 

Just searching for "Ubuntu LVM" will probably get you most of what you need to know. You'll need to make sure the LVM module is installed on your Ubuntu machine - "apt-get install lvm2" I think is what you want. That should install you the kernel module and a bunch of utilities. In particular the pvcreate, vgcreate and lvcreate commands are what you're going to need to set up LVM block devices:

 

Prepares a block device (partition, RAID volume, etc) for use as an LVM disk (in this case I'm telling Linux to use the whole of /dev/md0, a RAID volume - this will wipe any data from the entire RAID array):

pvcreate /dev/md0

 

Creates a Volume Group (here called xenVG, but use any name you like), ready to create Logical Volumes inside of:

vgcreate xenVG /dev/md0

 

Creates a logical volume (4GB in size, called ACSSPOOL007OS, and uses disk space from the xenVG Volume Group we created a minute ago):

lvcreate -L4G -nACSSPOOL007OS xenVG

 

This will create a new "disk" device called "/dev/xenVG/ACSSPOOL007OS" that you can use as you would any other disk block device, i.e. instead of, say, /dev/sda1.

 

--

David Hicks

  • Thanks 1
Posted
The problem is that it will be a crash consistent state backup, if the database and services were not stopped before the snapshot. This may mean you end up with a corrupt database when using lvm.

 

Hmm... Is there a way to also back up RAM and a seperate swap disk, all as part of the one transaction? I.e. if the Zimbra server was running as a virtual machine, is there a way to say "right, do a snapshot of RAM, swap disk A and data disk B... NOW"?

 

--

David Hicks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...