I am sure that I don’t need to drill you about the importance of backing up your system. Ideally the whole system is backed up, but this costs time and space.

However, as very convenient shortcut, there is an easy (and free) way of backing up the Zentyal server configuration. With this configuration backup you can quickly restore your Zentyal server to a production state. And it does not need to be the same box, you can also use the configuration backup to apply the configuration to a new server.

The configuration backup also includes all the user and group accounts so your users can continue logging in to the services they use.

There are several ways to make and restore the configuration backup. The more versatile is to use Zentyal Cloud Service that comes with the Free Account registration: this way the backup will reside in the cloud and you could apply it to any of your Zentyal boxes. You can get a free account here.

To access to this feature in the web interface, you must click in System -> Import/Export configuration. A console interface is also available through the programs ‘/usr/share/zentyal/make-backup’ and ‘/usr/share/zentyal/restore-backup’.

How this works?

To the curious among us, let me explain its internal workings. The backup is just an archive file in TAR format, that includes the files describing the configuration.

First, the backup process writes some files with metadata, like the current date or the packages installed in the system. Then it loops through the installed modules making each one to dump its configuration.

Remember that the configuration values we see reflected in the web interface are stored in a Redis backend. So each module must dump its Redis keys and value to a file. However the Redis keys are not sufficient for all modules. Remember that the users and its related data are stored in LDAP. In this case the users module does a dump of the full directory in LDIF format.

Likewise the samba module dumps its internal database and the modules which use OpenSSL certificates to store them in the backup archive.

When the backup is finished, it is stored in your local file system: you can download or restore it from the Zentyal web interface.

For restoring a backup the same process is run in reverse, picking each of the files and importing them to our Zentyal system.

Configuration backup and the Backup module

As you may known Zentyal also has a file backup module which allows you to set the files to be backed up, the destination of the backup and its frequency.

A configuration backup is added to the backup of the selected files to have better recovery odds.

Backup in the cloud

One problem remains in this configuration backup schema and it is to store it in a remote, always-accessible location. The location which meets these requirements is the Internet, now dubbed cloud.

Zentyal Remote offers this service. It checks daily your Zentyal configuration and the contents of the LDAP directory, if it finds any changes, it makes automatically a backup and sends it to the cloud.

The number of simultaneous held backups depends on the type of edition you have. A community edition with Free Account can store one configuration backup, a Small Bussiness or Enterprise edition can have up to seven configuration backups. Furthermore, the seven configuration backup-limit only applies to automatic backups, you can have as many manual backups as you like.

Once you have your backup in the cloud, you can restore it in any of your subscribed Zentyal servers using the web interface.

Post written by Javier Amor Garcia

A post by Julio José García Martín