Beruflich Dokumente
Kultur Dokumente
If you wish to have a more automated backup feature, you should try the [Network Version of Zimbra.]
Contents
1
2
3
4
Preparing to Back Up
Making a Backup
Restoring
Another option
Preparing to Back Up
Before we begin, make sure that you are logged in as a user that can perform the tasks outlined here.
It is always good practice to backup your copy of Zimbra in the event of unforeseen circumstances.
To prevent changes to any Zimbra databases during the backup processes you may wish to use:
>su zimbra
>zmcontrol stop
to terminate Zimbra.
If you get some kind of error, you may want to make sure that Zimbra has completely stopped by running:
>ps auxww | grep zimbra
and kill any left over processes such as the log.
Making a Backup
Make sure that the copy location has enough space to support your backup copy (i.e. the /tmp folder probably isn't the best location).
http://wiki.zimbra.com/wiki/Backing_up_and_restoring_Zimbra_(Open_Source_Version)#Another_option
1/6
10/24/2014
Since all of the components Zimbra needs are stored in the Zimbra folder itself, you can simply copy the folder to a safe location.
It may be possible to create a cron job to do these tasks automatically. This it the command:
>cp -rp /opt/zimbra [location of backup]/zimbra_backup
Depending on your hardware and the amount of data contained in your Zimbra installation, this process can take a while.
Note: It is a very good idea to tag your installation with the version/build of zimbra that will be backed up (ie 3.0.0_GA_156) and the
date of backup. You'll need this later.
Restoring
Before restoring, you should make sure that all of the processes associated with the damaged/failed Zimbra installation are terminated.
Failure to terminate all of the processes could have dire consequences. See "Preparing to Backup" for additional info.
1) Rename your "broken" Zimbra installation.
You may be able to scavenge data, if needed. If you simply do not want the old data, you can skip this part. This is how you do it:
>mv /opt/zimbra /opt/zimbra_broken
You may want to move it completly out of the /opt folder just to be safe. After that, copy your backup Zimbra installation to the /opt
folder and name it "zimbra" by using the following commands:
>cp -rp [location of backup]/zimbra_backup /opt
>mv /opt/zimbra_backup /opt/zimbra
Review the output and there should be an entry near the bottom that will show the last upgrade/install you did. It looks something like
this:
1203106102:
1203106124:
1203106126:
1203106134:
1203106150:
1203106154:
1203106167:
1203106171:
1203106173:
1203106173:
For non-rpm installations you might see .deb instead of .rpm but this should work on all platforms.
2/6
10/24/2014
>cd zcs
>./install.sh
WARNING: Do not run the script with the -u option. You will remove all of your backup data & you must run the script as root, NOT
ZIMBRA.
Another option
Zimbra Backup and Restore "hot". [By Richardson Lima http://br.linkedin.com/in/richardsonlima ]
BACKUP
* Script 1
* This script must be run as root, it runs the script runBackupAll.sh and also sends the entire backup to a second machine.
echo "*******************************************************"
echo "* Zimbra - Backup all email accounts
*"
echo "*******************************************************"
echo""
#
echo Start time of the backup = $(date +%T)
before="$(date +%s)"
#
echo ""
ZHOME=/opt/zimbra
http://wiki.zimbra.com/wiki/Backing_up_and_restoring_Zimbra_(Open_Source_Version)#Another_option
3/6
10/24/2014
ZBACKUP=$ZHOME/backup/mailbox
echo "Generating backup files ..."
su - zimbra -c "/opt/backup/SCRIPT_ZIBRA_BACKUP_ALL_ACCOUNTS/zimbra_backup_allaccounts.sh"
echo "Sending files to backup all email accounts for Machine2 (10.0.0.X - CrossOver Cable on eth1 \o/ ) ..."
rsync -avH $ZBACKUP root@ipaddress:/opt/zimbra_backup_accounts
before2="$(date +%s)"
#
echo The process lasted = $(date +%T)
# Calculating time
after="$(date +%s)"
elapsed="$(expr $after - $before)"
hours=$(($elapsed / 3600))
elapsed=$(($elapsed - $hours * 3600))
minutes=$(($elapsed / 60))
seconds=$(($elapsed - $minutes * 60))
echo The complete backup lasted : "$hours hours $minutes minutes $seconds seconds"
* Script 2
zimbraBackupAllAccounts.sh
ZHOME=/opt/zimbra
ZBACKUP=$ZHOME/backup/mailbox
ZCONFD=$ZHOME/conf
DATE=`date +"%a"`
ZDUMPDIR=$ZBACKUP/$DATE
ZMBOX=/opt/zimbra/bin/zmmailbox
if [ ! -d $ZDUMPDIR ]; then
mkdir -p $ZDUMPDIR
fi
echo " Running zmprov ... "
for mbox in `zmprov -l gaa`
do
echo " Generating files from backup $mbox ..."
$ZMBOX -z -m $mbox getRestURL "//?fmt=zip" > $ZDUMPDIR/$mbox.zip
done
RESTORE
* Script 3
* This script must be run as root, it runs the script runRestoreAll.sh and also sends the entire backup to machine.
zimbra_restore_allaccounts.sh
echo "*******************************************************"
echo "* Zimbra - Restore all email accounts
*"
echo "*******************************************************"
echo ""
#
echo Start Time Restore = $(date +%T)
before="$(date +%s)"
#
echo ""
echo "Starting the process restore the backup files ..."
su - zimbra -c "/opt/zimbra_backup_accounts/zimbra_restore_allaccounts.sh"
before2="$(date +%s)"
echo The process lasted = $(date +%T)
# Calculating time
after="$(date +%s)"
elapsed="$(expr $after - $before)"
hours=$(($elapsed / 3600))
elapsed=$(($elapsed - $hours * 3600))
minutes=$(($elapsed / 60))
seconds=$(($elapsed - $minutes * 60))
echo "The complete restore lasted : "$hours hours $minutes minutes $seconds seconds"
echo "Process completed successfully!"
* Script 4
zimbra_restore_allaccounts.sh
#!/bin/bash
ZHOME=/opt/zimbra
#!/bin/bash
ZHOME=/opt/zimbra
#ZBACKUP=$ZHOME/backup/mailbox
ZBACKUP=/opt/zimbra_backup_accounts/mailbox
ZCONFD=$ZHOME/conf
DATE=`date +"%a"`
ZDUMPDIR=$ZBACKUP/$DATE
http://wiki.zimbra.com/wiki/Backing_up_and_restoring_Zimbra_(Open_Source_Version)#Another_option
4/6
10/24/2014
ZMBOX=/opt/zimbra/bin/zmmailbox
if [ ! -d $ZDUMPDIR ]; then
echo "Backups do not exist !"
exit 255;
fi
for mbox in `zmprov -l gaa`
do
echo " Restoring files from backup $mbox ..."
$ZMBOX -z -m $mbox postRestURL "//?fmt=zip&resolve=reset" $ZDUMPDIR/$mbox.zip
done
Learn
What is Zimbra?
Benefits
Demos and Videos
Industry Solutions
Customers
Case Studies
Awards
Products
Zimbra Collaboration Server
Zimbra Cloud and Virtualization
Zimbra Open Source
Zimbra Desktop
Compare Products
Pricing
Whats New
Downloads
Community
Forums
Documentation
Wiki
Blog
Gallery
Submit Bug
Release Status
Developer Zone
Contribute
Support
Zimbra Support Program Overview
User Help
Zimbra Customer Support Portal
Partners
http://wiki.zimbra.com/wiki/Backing_up_and_restoring_Zimbra_(Open_Source_Version)#Another_option
5/6
10/24/2014
About
Careers
News
Events
Webinars
Media
Contact Us
Twitter
LinkedIn
Facebook
Email Software
Email Hosting
Zimbra Mail Server
Email Archiving and Compliance Software
Calendar and Collaboration
Microsoft Outlook Alternative
Zimbra for BlackBerry & iPhone
Secure Email & Anti Spam
Unified Messaging
Zimbra powers collaboration for the way you work. Zimbra connects people and information with unified collaboration software that
includes email, calendaring, file sharing, activity streams, social communities and more. With technology designed for social, mobile
and the cloud, Zimbra gives individuals the flexibility to work from virtually anywhere, through nearly every computer, tablet and
mobile device.
http://wiki.zimbra.com/wiki/Backing_up_and_restoring_Zimbra_(Open_Source_Version)#Another_option
6/6