Posts Tagged citadel backup

Backup and Restore Citadel Groupware

Posted by Filed Under Citadel with Comments Off

Backup and Restore
There are two different ways to backup Citadel.  This is the safest and most reliable.  The one disadvantage is that Citadel must be off to make this happen.

Offline Backup

The offline backup is used when you have set the Citadel server to automatically delete committed database logs. The setting to check to verify that you have this set is the Tuning Tab under Site Configuration.  You can see by default th e”Automatically delete committed database logs” is checked.

The citadel server must be stopped in order to complete this backup.

sudo  /etc/init.d/citadel stop

You will need to designate where to make the backup.  In the example script the backup is placed in the /home directory with a timestamp but certainly it should be placed in a directory on a separate partition in case you have drive problems.  This backup will backup everything that has to do with Citadel so it should restore and save you regardless of any issues.

Create a file in the /root directory called

Now copy this script into that file and save it.

chmod 755

Then execute the file with:

# Complete Backup for Citadel

TIMESTAMP=`date +%Y%m%d_%H%M%S`;
tar -cvf /home/citadel_$TIMESTAMP.tar /etc/citadel /usr/lib/citadel-server/ /var/lib/citadel/ /var/spool/citadel/ /var/run/citadel/ /usr/sbin/citserver /usr/sbin/sendcommand /usr/sbin/sendmail /usr/bin/citadel/ /etc/init.d/citadel /etc/init.d/webcit /usr/share/doc/citadel-server/ /usr/share/locale /usr/share/citadel-server/

Here you can see what the timestamped backup looks like.
-rw-r–r–  1 root root    10240 2009-01-24 13:23 citadel_20090124_142509.tar

Be sure to start the server once it is complete.

Offline Restore
The offline restore will also require you to have the server turned off.

sudo  /etc/init.d/citadel stop

Move to the location of the backup tar file so that when you do ls you can see the tar file.

tar xvf  citadel_20090124_142509.tar -C /

The -C / at the end will restore all of the directories in relationship to the / or root of the filesystem.

You could create a tar on one server and move to a second server with the same distro and restore on the new box, thus replicate the whole system on a second box.