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 Display Modes
  #1 (permalink)  
Old 09-08-2009, 07:51 AM
Intermediate Member
 
Posts: 22
Default Zimbra Backup Question

Good day,

We are finalizing our migration from one O/S to another and found an oddity within the process that I am hoping someone can shed light on. Version of Zimbra is 5.0.4 on OpenSuse 10.2

For our backups of Zimbra, we rsync the entire /opt/zimbra directory to the backup server with the following options: rsync -avHK. While testing our migration, we rsynced (rsync -avH) the /index, /store, /db/data and /logger/db directories from our backups to a separate hard drive then used this information to restore Zimbra with a script we came up with. The script will rsync the data again into the new installation of Zimbra (rsync -avH --delete) This all works fine except for one issue.

Last month, we had the entire company go through a password change. When we do the migration/restore on a test box, we end up with a working server, but using the old passwords. Backups run nightly and the four directories were rsynced (several times) from the backups after the password change so we would have expected our backups to contain the correct information.

The backup script is more defined here:
MAX_ROTATIONS=20
ROOT_DIR=/backup
SSH_KEY=/root/.ssh/id_dsa_backup.key
doitLinux () {
local LOG_FILE=$ROOT_DIR/${HOSTNAME}.${SHARE}.log

rm -rf $ROOT_DIR/$HOSTNAME/$SHARE.$MAX_ROTATIONS
for c in $( seq $MAX_ROTATIONS -1 2 ); do
mv -f $ROOT_DIR/$HOSTNAME/$SHARE.$((c-1)) $ROOT_DIR/$HOSTNAME/$SHARE.$((c)) 2> /dev/null
done

# Create the initial backup and difference directories if they don't exist.
mkdir -p $ROOT_DIR/$HOSTNAME/$SHARE
mkdir -p $ROOT_DIR/$HOSTNAME/$SHARE.1

echo "#########################################" > $LOG_FILE
echo "# Backup started for $HOSTNAME on `date` " >> $LOG_FILE
echo "#########################################" >> $LOG_FILE

rsync -avH $OPTIONS \
--partial \
--delete \
--backup --backup-dir=$ROOT_DIR/$HOSTNAME/$SHARE.1 \
-e "ssh -i $SSH_KEY" \
$SOURCE_DIR \
$ROOT_DIR/$HOSTNAME/$SHARE \
>> $LOG_FILE

############################
# ZIMBRA
############################
HOSTNAME=ZIMBRA
SHARE=zimbra
SOURCE_DIR=10.2.32.8::zimbra
OPTIONS=-K

doitLinux


So, what are we missing? Is the issue with how we are backing up the data?

Sir Bob

Last edited by Sir Bob : 09-08-2009 at 08:17 AM.
Reply With Quote
  #2 (permalink)  
Old 09-08-2009, 10:49 AM
Moderator
 
Posts: 789
Default

passwords are stored in ldap, you probably need to get /opt/zimbra/openldap too

still not a very good method of doing backups, copying databases taht are running just by copying the flat files can lead to problems.
Reply With Quote
  #3 (permalink)  
Old 09-08-2009, 11:19 AM
Intermediate Member
 
Posts: 22
Default

Thank you for the quick response.

To expand on the backup solution we use, Zimbra services are stopped when the backup server connects through an authenticated key. This key runs a script that shuts down Zimbra (so no changes can occur to LDAP or MYSQL), starts a rsync server instance on the email server, then the /opt/zimbra directory is rsynced to the backup server before restoring the Zimbra services. Most of the forums we had read on backups state all that is needed is to shut down Zimbra then back up the /opt/zimbra directory and you are good to go.

If you could suggest a better way of doing our backups, please do so. To date (knock on wood), we have not had a need to restore from backups so this issue is opening our eyes to potential problems.

And, yes, your idea of bringing over the ldap for the migration makes sense.

Sir Bob

Last edited by Sir Bob : 09-08-2009 at 11:44 AM.
Reply With Quote
  #4 (permalink)  
Old 09-08-2009, 11:59 AM
Moderator
 
Posts: 789
Default

if you're stopping zimbra you're probably fine then. there are several threads on this forum about backup scripts for the oss version if you wanted to look at what others are doing. you should try to do a full recovery test though as you said it points out flaws you may not have known about.
Reply With Quote
Reply


Thread Tools
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.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0