Backup

Zentyal uses Duplicity [1] to make backups.

[1]Duplicity: http://duplicity.nongnu.org/

Data backup configuration in a Zentyal server

Before starting with the configuration, please note that this module is only available in the Commercial Editions.

First of all, you can access the data backup configuration by going to Backup section in the main menu.

Then, you have to decide whether you are going to store your backups locally or remotely. In the latter case, you need to specify which protocol is going to be used to connect to the remote server.

Data backup configuration - SCP method

Data backup configuration - SCP method

Method:
The different supported methods are FTP, RSYNC, SCP and File system. Take into account that depending on the method you choose, you will have to provide more or less information. All the methods except File system use remote servers. If you select FTP, RSYNC, or SCP, you will have to enter the address of the remote server and the associated authorisation to connect with the server.

Warning

When using ‘SCP’, you have to run “sudo ssh user@server” and accept the server fingerprint in order to add it to the list of known SSH servers. If you do not perform this operation, the backup will not work, because the connection with the server will fail.

Host or destination:
For remote methods (FTP, SCP and RSYNC) you have to enter the remote server name or its IP address with the following format: other.host:port/existing_directory. In case you are using File system, you only need the local directory path.

Warning

In general, if the path of the directory where the backup will be stored contains just a simple ‘/’, it means that is a relative path, meanwhile if the path contains two ‘//’ means it is absolute. See this link [2] for more information.

User:
User name to authenticate in the remote host.
Password:
Password to authenticate in the remote host.

Warning

When using the ‘RSYNC’ method, the authentication with the remote server will be done through keys. Therefore, you will have to generate first keys in the server and later, copy the public key that has been generated in the remote server.

Encryption:
The backup data can be encrypted by using a symmetric key that will be entered in the form.
Full Backup Frequency:
This parameter is used to determine the frequency for complete backups to be performed. The values are: Only the first time, Daily, Weekly, Twice a month and Monthly. If Weekly, Twice a month or Monthly is selected, you will see additional option to choose the exact day of the week or month to perform the backup. If Only the first time is selected, then it is mandatory to set a frequency for incremental backups.
Incremental Backup Frequency:

This value sets the frequency of the incremental copy or disables it.

If the incremental copy is enabled, you can choose a Daily or Weekly frequency. In the latter case, you have to decide the day of the week. Either way, you have to take into account that the chosen frequency has to be greater than the full backup.

Warning

The days that you have scheduled a full backup, Zentyal will not perform any scheduled incremental copy.

Backup process starts at:
This field is used to set the time a backup copy is started, for both the full and the incremental backup. It is a good idea to set it to hours when there is no one in the office as the process can consume quite a bit of upload bandwidth.
Keep previous full copies:

This value is used to limit the total number of copies that can be stored. You can limit by number or by age.

If you limit by number, only the configured number of copies, plus the last complete copy will be stored. If you limit by age, you will only save full copies that are newer than the indicated period.

Warning

When a full copy is deleted, all the incremental copies associated with it are also deleted.

[2]Duplicity paths: http://duplicity.nongnu.org/vers8/duplicity.1.html#sect7

Configuration of the directories and files that are backed up

From the Includes and Excludes tab, you can configure the specific data you want to backup.

The default configuration will perform a copy of all the file system except the files and directories explicitly excluded. In case you are using the File system method, the destination directory and all its contents will be automatically excluded as well.

You can set path exclusions and exclusions that match a regular expression. Exclusions by regular expression will exclude any path which matches the expression. Any excluded directory will also exclude all its contents.

In order to further refine the backup contents, you can also define inclusions. When the path matches an inclusion before it matches with an exclusion, it will be included in the backup.

The order of application of inclusions and exclusions can be changed using the arrow icons.

The default list of excluded directories is: /mnt, /dev, /media, /sys, /tmp, /var/cache and /proc. It is a bad idea to include any of these directories, because they may cause the backup process to fail.

A full copy of a Zentyal server with all its modules, but without user data will be around 300MB.

Inclusion and Exclusion list

Inclusion and Exclusion list

Checking the status of the backups

You can check the status of the backups in the Remote Backup Status section. In this table, you can see the type of backup (full or incremental) and when the backup was taken (date).

Status of the available backups

Status of the available backups

Restore files

There are two ways to restore a file. The recommended method depends on the size of the file or directory that you want to restore.

It is possible to restore files directly from Zentyal server control panel. In the Backup ‣ Restore files section you have access to the list of all the files and directories included in the remote backup, and the dates of the different versions you can restore.

If the path to restore is a directory, all its contents will be restored, including sub-directories.

The file will be restored with its contents on the selected date. If the file is not present in the backup of that day, the first version found in the previous backups will be restored. If there is no copy of the file in any of the previous versions, you will be notified with an error message.

Warning

The files shown in the interface are the ones that are present in the last backup. The files that are stored in former copies, but not in the last one, are not shown, but they can be restored using the command line.

You can use this method with small files. With large files, the process is time consuming and you can not use the Zentyal web interface while the operation is in progress. You have to be especially careful with the type of file you are restoring. Normally, it will be safe to restore data files that are not being used by applications at the current time. However, restoring system files from /lib, /var or /usr directories while the system is running can be very dangerous. Don’t do this unless you are really sure of what you are doing.

Restoring an email from the backup

Restoring an email from the backup

Restore services

Apart from the selected files, additional data is stored to allow the direct restoration of some services. This data includes:

  • Zentyal configuration backup
  • Backup of the Zentyal logs database

In the tab Backup –> Services Restore both can be restored for a given date.

The Zentyal configuration backup contains the configuration of all the modules that have been enabled at least once, all the LDAP data and any other additional files required by the modules to function properly.

You have to be careful when restoring the Zentyal configuration because all the current configuration and LDAP data (users, groups, etc.) will be replaced to make this effective.

Restoring services

Restoring services