18.2  Backup of user folders

Kerio MailServer enables regular backups of user folders and configuration files on a corresponding media. For this purposes, any removable or network disk can be used.

Kerio MailServer makes a backup of the entire store data directory and of the users.cfg and mailserver.cfg configuration files.

Backups of user folders include various settings. To configure backups, go to the Backup tab under Configuration → Archiving & Backup:

Backup of user folders

Figure 18.4. Backup of user folders


Enable message store and configuration recovery backup

Use this option to back up all user folders together with the current Kerio MailServer configuration. It applies to the whole store data directory and users.cfg and mailserver.cfg files.

If you do not wish to use Kerio MailServer's backup functions, disable the Enable message store and recovery backup option. If you remove all items in the backup schedule and leave the option active, the default backup schedule is downloaded and applied upon a Kerio MailServer's restart.

Warning:

Backup Schedule

On the Backup tab, backups can be scheduled in details. Two backup types can be scheduled:

  • Full backup — full backup of all files.

  • Differential backup — a partial backup, including all changed and new files. These backups are not so bulky. Typically, partial backups complement a full backup. If multiple differential backups in row are scheduled, the newest backup always rewrites the previous one. This means that at most one differential backup can be saved on the backup disk besides the full backup.

    Note: If the method of differential backups is used, the most recent full and differential should be used in case that a backup recovery is performed.

The backup schedule is defined by backup tasks. Each task includes settings for time when the particular backup will be performed and selection of a backup type (see above). To add a new backup task to the schedule, click Add. A backup schedule definition window is opened (see figure 18.5  A backup task) that includes the following setting options:

A backup task

Figure 18.5. A backup task


Description

This is an optional item, it is used for better reference.

Schedule

The box includes two entries where day and time are selected for the backup. It is recommended to perform backups at night (especially full backups) since backups might overload the mailserver.

Backup type

Selection of either the full or differential backup type.

The Add button opens a definition of a new backup task. You can also click theEdit button to edit a corresponding task or Remove to remove a task from the schedule.

Both backup types can be combined by using multiple tasks. Any number of backup tasks can be defined. This depends on the user. Number of backup tasks may depend on:

  1. Size of the data store which influences how long each backup takes and on its size. Both problems might be easily solved by using differential backups.

  2. Importance of data which might be lost. This implies that backups are typically more frequent in companies where email communication and message storing is important. If backups are performed frequently, minimum of data is lost in case of the server's failure.

Click Advanced for advanced settings (see figure 18.6  Backup advanced options):

Backup advanced options

Figure 18.6. Backup advanced options


File settings

Backups are saved in compressed files (.zip) where the maximal size of 2 GB is allowed. This box enables you to split the backup to several files of smaller size. The maximal file size for splitting is set to 2 GB by default. If a file exceeds the value set in the dialog, the file is not backed up.

Rotation

Each backup of user folders is very space-demanding and it might be desirable to often remove these backups. It is possible to set rotation where old backups are removed automatically. Just specify number of backups to be kept in the Keep at most ... complete backups. Whenever the number is exceeded, the oldest backup is rewritten by the new one.

Other settings

Backup directory

Specification of the complete path to the backup directory (according to conventions of the operating system on which Kerio MailServer is installed).

The default backup store is in the directory where Kerio MailServer is installed:

Kerio\MailServer\store\backup

Backup directory specification

Figure 18.7. Backup directory specification


Warning: It is recommended to change the backup directory by setting the path to the corresponding removable disk or another media where the backup will be stored if available.

If Kerio MailServer is running on Windows, the path must be specified as UNC (see figure 18.7  Backup directory specification).

If Kerio MailServer is running on Linux or Mac OS, the following options are allowed:

  • Connect the backup server as a directory and specify the path to this directory in the Backup Directory entry. Here is an example of a result:

    /mnt/server-backup

  • Save the backup in a local directory and then, send it to the server (e.g. by using the rsync synchronization utility). Here is an example of a result:

    /backup/kms/backup

Each archive consists of backup type and date when it was created:

  • Full backup — F20060118T220007Z.zip

    F — full backup

    2006 — year

    01 — month

    18 — day

    T220007Z — GMT timestamp (22:00:07);it always starts with T and ends with Z.

  • Differencial backup — I20060106T220006Z.zip

    I — differential backup

    2006 — year

    01 — month

    06 — day

    T220006Z — GMT timestamp (22:00:06);it always starts with T and ends with Z.

  • Backup copy (manual back up startup) — C20060117T084217Z.zip

    2006 — year

    01 — month

    17 — day

    T084217Z — GMT timestamp (08:42:17);it always starts with T and ends with Z.

Network disk authentication

In addition to saving backups to removable media it is also possible to store save backups to a network disk. If access to the disk is secured, authentication by username and password must be enabled (a user with access rights to the network location must be used).

Username and password for authentication to the network disk can be used only if Kerio MailServer is installed on MS Windows.

Network disk authentication

Figure 18.8. Network disk authentication


Notifications

Specify an email address where notifications about the backup status will be sent by Kerio MailServer.

In addition to backups set in the schedule, it is also possible to make so called backup copies. The copy is a kind of full backup. The copy can be enabled by the Start now button. The current status of the backup process appears next to the button. In case of a backup recovery, the copy is considered as a standard full backup and it is used for the recovery if it is the most recent copy performed.

Recovery

A special application called Kerio MailServer Recover is used for recovering of the backup data. This application performs decompression of the particular backup and saves it in the store directory.

To launch Kerio MailServer Recover, run the kmsrecover command from the directory where Kerio MailServer is installed.

Usage:

kmsrecover <directory_name>|<file_name>

Warning: On Mac OS X and Linux it is necessary to enter a command on the following format, unless having already been introduced in the file of the path system variable:

./kmsrecover <directory_name>|<file_name>

This means that it is necessary to add the ./ string before the utility name that will inform the system that the command to be used is in the current directory.

You can also see these details and examples to individual attributes, by running the kmsrecover command.

Warning:

  • It is necessary to stop the Kerio MailServer Engine prior to the recovery.

  • Applying a full or copy backup will overwrite the existing store. Applying any backup will overwrite the existing configuration.

Backup recovery will be better understood through this simple example:

Windows

The recovery is performed on a host using MS Windows. The directory with configuration data is stored at the default location (as set as default during the installation), the store directory is located on a separate disk (RAID or a faster disk) of the same computer where the configuration directory, and the backup directory is located on an exchangeable disk. For backup recovery, use full backup.

Conditions:

  1. The configuration data is stored under

    C:\Program Files\Kerio\MailServer

  2. The store directory is located in

    D:\store

  3. For security purposes, the backup directory is stored on the removable disk

    E:\backup

Solution:

The command must be run from the directory where Kerio MailServer is installed. In this case, the directory is

C:\Program Files\Kerio\MailServer

At this point, two command formats can be used:

  1. We want to recover the last complete backup (the most recent full and differential backups or the most recent backup copy). The command will be as follows:

    kmsrecover E:\backup

  2. To recover a particular backup (except the last one), use the following format:

    kmsrecover E:\backup\F20051009T220008Z.zip

The kmsrecover detects the path to the store (D:\store) automatically in the Kerio MailServer's configuration file and uses it.

Warning: If the parameter contains a space in a directory name, it must be closed in quotes. For example:

kmsrecover "E:\backup 2"

Mac OS X

The recovery is performed on a host using Mac OS X. The directory with configuration data is stored at the default location (as set as default during the installation), the store directory is located on a separate disk of the same computer where the configuration directory, and the backup directory is located on an exchangeable disk. For backup recovery, use the most recent full backup.

Conditions:

  1. The configuration data is stored under

    /usr/local/kerio/mailserver

  2. The store directory is located in

    /store

  3. For security purposes, the backup directory is stored on the removable disk

    /Volume/backup

Solution:

The command must be run from the directory where Kerio MailServer is installed. Therefore, it is necessary to go to the directory:

/usr/local/kerio/mailserver

We want to recover the last complete backup (the most recent full and differential backups or the most recent backup copy). Now, the command pattern depends on the fact whether the path to the Kerio MailServer directory is included in the path variable or not. If the path is not set there, the command will be as follows:

./kmsrecover /Volume/backup

Otherwise, it will be like this:

kmsrecover /Volume/backup

The kmsrecover detects the path to the store (/store) automatically in the Kerio MailServer's configuration file and uses it.

Troubleshooting

For cases when a problem regarding backups occurs and needs to be solved, Kerio MailServer allows logging of backups:

  1. In the Kerio Administration Console, go to the Logs section and select the Debug log.

  2. Right-click on the log pane to open a context menu, and select Messages.

  3. In the Logging messages dialog box, select Store Backup.

  4. Confirm changes by OK.

Once your problems are solved, it is recommended to disable the logging.