Hi Igor, thanks for your great feedback,

Looks like what I had in mind. :-)


        regards . Götz



Am 20.06.13 18:30, schrieb Igor Vitorac:
> I have read many backup/restore hints and I have made the following:
> - I have one backup scripts that dumps all SOGo calendars and user
> settings with sogo-tool. Please see below "HELPER BACKUP script"
> - I have second backup script that picks output from first script and
> takes the "rest" Please see below "MAIN BACKUP file"
> - My backup is based on sogo-tool which is MUCH more safer then simple
> DB dump. I am doing additional DB dump as well, just to have additional
> way to troubleshoot the problems. Backup with sogo-tool is safer since
> it enables you to restore SOGo on newer version which is the case very
> often. With simple DB dump you may have problems if you want to install
> on fresh SOGo instance with higher version (unless you compile the same
> version).
> 
> 
> -------------- HELPER BACKUP script --------------
> #!/bin/sh
> # This script is used to backup Sogo calendars and user setttings.
> # It must be executed as sogo user
> 
> date=`date -I`
> 
> #Backup Sogo data files
> cd /home/sogo/backup/
> /usr/sbin/sogo-tool backup daily_$date ALL > backup_report.txt 2>&1
> mv backup_report.txt ./daily_$date/
> /usr/bin/defaults read sogod > ./daily_$date/sogo_conf_text.backup
> 
> # these files has to be taken by root cron job for KRONOS backup
> tar -cjf daily_$date.tar.bz2 daily_$date
> 
> # remove files once packed to archive
> rm -rf /home/sogo/backup/daily_$date
> 
> #Remove old backup archives
> /usr/bin/find /home/sogo/backup -name \*.tar.bz2 -mtime +3 -exec /bin/rm
> -f {} \;
> -------------- END HELPER BACKUP script --------------
> 
> 
> -------------- MAIN BACKUP file --------------
> #!/bin/sh
> # This script is used to backup Sogo
> date=`date -I`
> 
> ################ Stoping some services
> #Stop apache server
> /etc/init.d/httpd stop
> 
> ################ Files
> #Backup Sogo data files
> # there is another sogo user cron script that backups calendars 1 hour
> before this script
> cd /root/kronos_backup/backup/
> tar -cjf sogo_home_$date.tar.bz2 /home/sogo/
> 
> ################ DBs
> #Backup DBs
> /usr/bin/mysqldump --user=root --opt --databases sogo > sogo_bkp_$date.sql
> /usr/bin/mysqldump --user=root --opt --databases mysql >
> mysql_bkp_$date.sql
> /usr/bin/mysqldump -u root sogo sogo_users > sogo_users_bkp_$date.sql
> 
> # Backup for etc folder
> tar -cjf etc_backup_$date.tar.bz2 /etc
> 
> # Pack the DB files
> tar -cjf SOGO_DB_$date.tar.bz2 sogo_bkp_$date.sql
> tar -cjf MySQL_DB_$date.tar.bz2 mysql_bkp_$date.sql
> tar -cjf SOGO_USERS_TBL_$date.tar.bz2 sogo_users_bkp_$date.sql
> 
> # Remove sql files
> rm -f sogo_bkp_$date.sql
> rm -f mysql_bkp_$date.sql
> rm -f sogo_users_bkp_$date.sql
> 
> ################ Cleanup
> #Remove old files
> /usr/bin/find /root/kronos_backup/backup -name \*.tar.bz2 -mtime +2
> -exec /bin/rm -f {} \;
> 
> ################ Starting services
> #Start apache server
> /etc/init.d/httpd start
> 
> -------------- END MAIN BACKUP file --------------
> 
> 
> 
> When it comes to the restore/migration part:
> - you install clean SOGo
> - sogo user source restore depends from your deployment
> - restore SOGo config (from config made above):
> sudo -u sogo defaults write < sogo_conf_text.backup
> - restore SOGo calendar and user settings with the script like following:
> 
> #!/bin/bash
> for i in $( ls /home/sogo/temp/ALL/daily_2013-04-01/); do
>       echo "Processing $i user..."
>       sudo -u sogo sogo-tool restore -F ALL
> /home/sogo/temp/ALL/daily_2013-04-01 $i
>       sudo -u sogo sogo-tool restore -p
> /home/sogo/temp/ALL/daily_2013-04-01 $i
> done
> 
> 
> Pay attention that above has been tested on SOGo 2.0.4b with config
> located in .Defaults file.
> 
> Hope this helps. Do not hesitate to ask for additional clarification.
> 
> Regards,
> Igor
> 
> 
> 
> Götz Reinicke - IT Koordinator wrote, On 19/06/2013 13:28:
>> Hi,
>>
>> I'd like to ask what is your best practice to backup & restore your sogo
>> system and/or user data?
>>
>> Should we do a e.g. database dump/backup of the mysql (what we already
>> do for other systems) and do a user based sogo-tool backup?
>>
>> Regarding the sogo-tool, is there a way to do incremental backups and is
>> it somehow possible to do backups of user groups?
>>
>>     Thanks for any suggestion . Regards . Götz
> 
> 


-- 
Götz Reinicke
IT-Koordinator

Tel. +49 7141 969 82 420
Fax  +49 7141 969 55 420
E-Mail goetz.reini...@filmakademie.de

Filmakademie Baden-Württemberg GmbH
Akademiehof 10
71638 Ludwigsburg
www.filmakademie.de

Eintragung Amtsgericht Stuttgart HRB 205016

Vorsitzender des Aufsichtsrats: Jürgen Walter MdL
Staatssekretär im Ministerium für Wissenschaft,
Forschung und Kunst Baden-Württemberg

Geschäftsführer: Prof. Thomas Schadt

Attachment: smime.p7s
Description: S/MIME Kryptografische Unterschrift

Reply via email to