Backup

Zentyal uses [1] Duplicity to make backups.

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

Data backup configuration in a Zentyal server

Before start with the configuration, note that this module is only available in the commercial version.

First of all, you can access the data backup menu going to System ‣ Backup

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 the remote server.

_images/backup-general.png

Data backup configuration

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 associated authorisation to connect with the server and the remote server’s address.

Warning

When using SCP, you have to run “sudo ssh user@server” and accept the server fingerprint in order to add to the list of servers known by SSH. 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 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.

User :

User name to authenticate in the remote host.

Password :

Password to authenticate in the remote host.

Warning

In case of using the ‘RSYNC’ method, the authentication with the remote server will be done through keys, so we will have to generate some keys in the server and later, copy the public key that has been generated in the remote server.

Encryption :

You can cypher the data in the backup 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 a selection 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 the chosen frequency which has to be greater than the full backup.

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 a time frame where no other activities are being performed in the network, because it can consume a lot of upstream 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 set 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.

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

Configuration of the directories and files that are saved

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 method File system, the destination directory and all its contents will be 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.

_images/backup-includes.png

Inclusion and Exclusion list

Checking the status of the backups

You can check the backups status in the Remote Backup Status section. Within this table, you can see the type of backup; full or incremental and the execution date.

_images/backup-list.png

Available backup list

Restore files

There are two ways of restoring a file. Depending on the file size or the directory you want to restore.

It is possible to restore files directly from Zentyal server’s control panel. In the System ‣ Backup ‣ Restore files section you have access to the list of all the files and directories contained 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 that day. The version found in the former backups will be restored. If there is no copy of the file in any of the 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. For big files, the process is time consuming and you can not use the Zentyal web interface while the operation is being made. 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. These data files are located in the directory /home/samba. On the other hand, restoring system file of directories like /lib, /var or /usr while the system is running can be very dangerous. Don’t do this unless you are really sure of what you are doing.

_images/backup-restore.png

Restoring a mail

Restore services

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

  • Zentyal configuration backup
  • backup of the registers database of Zentyal

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

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

You have to be careful when restoring Zentyal configuration because all the current configuration and LDAP data will be replaced. Nevertheless, for the case of configuration not stored in LDAP, you have to click “Save changes” to make this effective.

_images/backup-service.png

Restoring services