Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-2009, 04:45 AM
Member
 
Posts: 13
Default [SOLVED] Question about backup Zimbra

Hello, I am a newbie on Zimbra and even linux....

My system is CentOS 5.3 and ZCS 6.0.

I would like to ask about backup on my Zimbra.

I had tried to read the backup topic on zimbra wiki, and I got some scripts. However, I don't exactly know what is going on [poor in scripting X_X ].
Now, I have some question on the backup procedures.
Do I need to backup the MYSQL DB? or just the zimbra folder?

Apart from the backup script . Does it works If I just copy /opt/zimbra to another location [e.g. /Zimbra-backup] ?

sorry for the silly question...

Thanks a lot.
Otac
Reply With Quote
  #2 (permalink)  
Old 10-21-2009, 06:44 AM
Moderator
 
Posts: 1,554
Default

I don't know much about the community developed backup scripts because we use the network edition, but yes you definately need the mysql dbs. the messages are stored as plain files in /opt/zimbra/store but all hte metaata about them as well as their location wtihin a mailbox is stored in the sql database. theres other things like the ldap database that have to be backed up to.

As far as just backing up /opt/zimbra goes, this should only be done if you are able to stop zimbra for the duration of your backup. The reason is you do not want to be backing up files that are being written to at the time, especially sql databases (this can lead to corruption). So if you can stop zimbra, backup the /opt/zimbra directory, then start it then this isn't a half bad disaster recovery method.
Reply With Quote
  #3 (permalink)  
Old 10-21-2009, 07:26 AM
Moderator
 
Posts: 927
Default

Although I dont use it myself, I think you can 'freeze' the drive if it's formatted with LVM so the backup can be taken while Zimbra is running. I think one of the community scripts would handle this for you.
Reply With Quote
  #4 (permalink)  
Old 10-21-2009, 09:02 AM
Member
 
Posts: 13
Default

thank you for all replies.

it is ok for me to stop the zimbra during mid-night.
Does the script (found in forum) backup SQL DB too?

Thanks again
Reply With Quote
  #5 (permalink)  
Old 10-21-2009, 11:29 AM
Moderator
 
Posts: 1,147
Default

Most of the backup scripts for the OS version that you find here use one of these methods:
  1. The simple method
    Advantages: Simple
    Disadvantages: Longest downtime of all the methods
    1. Shut down Zimbra
    2. Copy /opt/zimbra
    3. Start Zimbra
  2. Rsync method
    Advantages: Relatively Simple, much quicker then the above method
    Disadvantages: Still a noticeable downtime that will increase as your system grows
    1. rsync the /opt/zimbra directory to the backup directoy while Zimbra is running
    2. Shut down Zimbra
    3. rsync again while Zimbra is offline to get the "real" backup
  3. LVM method
    Advantages: Downtime is virtually non-existent
    Disadvantages: /opt/zimbra must be on a LVM volume, so this must have been setup when the system was installed (or migrated later)
    1. Shut down Zimbra
    2. Create a LVM snapshot of the volume Zimbra is on (almost instant)
    3. Start Zimbra
    4. Mount the snapshot and copy/rsync the backup from that

All of these methods accomplish a complete copy of the /opt/zimbra directory which is all you need to backup everything about Zimbra. I use the LVM method on my server as the total downtime is only as long as it takes to do "zmcontrol stop; zmcontrol start"
Reply With Quote
  #6 (permalink)  
Old 10-21-2009, 05:40 PM
Member
 
Posts: 13
Default

Thanks, very details.
That's mean I don't need to backup MYSQL DB? or I need to do it separately?
Thanks again

Quote:
Originally Posted by ArcaneMagus View Post
Most of the backup scripts for the OS version that you find here use one of these methods:
  1. The simple method
    Advantages: Simple
    Disadvantages: Longest downtime of all the methods
    1. Shut down Zimbra
    2. Copy /opt/zimbra
    3. Start Zimbra
  2. Rsync method
    Advantages: Relatively Simple, much quicker then the above method
    Disadvantages: Still a noticeable downtime that will increase as your system grows
    1. rsync the /opt/zimbra directory to the backup directoy while Zimbra is running
    2. Shut down Zimbra
    3. rsync again while Zimbra is offline to get the "real" backup
  3. LVM method
    Advantages: Downtime is virtually non-existent
    Disadvantages: /opt/zimbra must be on a LVM volume, so this must have been setup when the system was installed (or migrated later)
    1. Shut down Zimbra
    2. Create a LVM snapshot of the volume Zimbra is on (almost instant)
    3. Start Zimbra
    4. Mount the snapshot and copy/rsync the backup from that

All of these methods accomplish a complete copy of the /opt/zimbra directory which is all you need to backup everything about Zimbra. I use the LVM method on my server as the total downtime is only as long as it takes to do "zmcontrol stop; zmcontrol start"
Reply With Quote
  #7 (permalink)  
Old 10-21-2009, 05:50 PM
Moderator
 
Posts: 1,147
Default

The MySQL database is within the Zimbra directory, so no you don't need to back it up separately.
Reply With Quote
  #8 (permalink)  
Old 10-21-2009, 08:02 PM
Member
 
Posts: 13
Default

Thanks a lot.
May I have a conclusion as below...

Backup procedure.
1) Shutdown Zimbra
2) copy whole Zimbra folder (/opt/zimbra) to another location (e.g. /Zimbra-backup)
3) Start Zimbra

Restoration.
1) shutdown zimbra
2) move the old (or bad) zimbra (/opt/zimbra) to another location (e.g. /zimbra-old)
3) copy the backup to /opt/zimbra
4) start zimbra

Am I right?
Thanks

Quote:
Originally Posted by ArcaneMagus View Post
The MySQL database is within the Zimbra directory, so no you don't need to back it up separately.
Reply With Quote
  #9 (permalink)  
Old 10-21-2009, 08:37 PM
Moderator
 
Posts: 1,147
Default

Yes that would work. You might also want to take a look at Open Source Edition Backup Procedure - Zimbra :: Wiki
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.