In order to optimally design our website and to show appropriate offers we are using cookies. By continuing to use our website you agree that we set cookies. More information

Scheduled backups in cPanel and Plesk

Creating backups is a very important task for every server administrator. A loss of data often occurs suddenly without a warning. It is possible to create backups manually, but we would recommend to configure automatic backups. The steps below were tested by us, but you should always check yourself if the backups are still running from time to time and if it is possible to restore the required data from it! A backup should be stored outside of the system. In the examples below we are using the Contabo Backup Space. You can order it additionally to your server.

Scheduled backups in cPanel

To configure automatic backups in cPanel, please go to WHM > Backup > Backup configuration. At first you have to set the tick at "Enable Backups". Then we would recommend to set the backup to "compressed". With incremental backups, you can not save to FTP in cPanel. The other global settings should be left the way they are.

In the section "Scheduling and Retention", it is useful in most cases to select every day of the week except Sunday and to keep six of those daily backups. Furthermore you should enable weekly backups and keep four of them, just in case a problem is noticed later or with some delay. Please create the weekly backups on Sunday, the day we left out in the section for the daily backups.

If you are not sure what you should backup in the next section, you can just select everything as shown in the image below. If you need to save backup space, you can unselect the system files and change the database backups from "Per account and entire MySQL Directory" to "Per account only". Normally the files and databases of the accounts will contain the most important data and the other parts contain settings that can be reconfigured after reinstalling the server in case of a full loss of data.

The next settings should be left the way they are. Especially the option "Mount Backup Drive as Needed" should be left without a tick, as this will cause problems if /backup is no mount point for a separate partition or drive:

Then please click on "Additional Destinations" at the top of the site. There you can configure the remote storage for your backup. You will find the correct settings for the Contabo Backup Space below. Unfortunately cPanel does not support ftps, so you should leave the tick for "Transfer System Backups to the Destination" unselected. Please confirm and save your data with the option "Save and Validate Option".

Backups can be restored in WHM > Backup > Backup Restoration. There you can select "Restore by Date" and you will see all available backups in the calendar. Please select the date with the last known good state and move the users you want to restore into the restoration queue. With "Restore", you will restore all the listed accounts.

Scheduled backups in Plesk

To configure automatic backups in Plesk, please go to Tools & Settings > Tools & Resources > Backup Manager > Schedule .
On the site, please put a tick at "Activate this backup task". Then select a reasonable time for your backups. As backups require a lot of resources and might slow down your system, you should perform your backups in the night, for example at 2:00 am. In the most use cases it is a good idea to configure daily incremental backups and to perform a full backup once a week. Incremental backups will just store the changes, so it is possible to restore your data from every available day. But the required backup storage is less than with a daily full backup. In the section "Backup settings", you can add a remote ftp backup storage. This makes sense, as the backup is then stored independently from your system. Please fill in your credentials in the form that opens and enable passive mode and FTPS as shown in the image below:

After the remote backup storage got added, please select that you want to store the backups locally and on the remote FTP storage you just added. Also it makes sense to add an e-mail address where the server can inform you in case something goes wrong during your backup task. Please check your settings with the help of the image below and click on apply.

After the the first backup is done, you should see a list of the available backups listed by day and time in Tools & Settings > Tools & Resources > Backup Manager. To download or restore a backup, please klick on the required backup. In the section "Backup content", you can choose between restoring "Selected objects" and "All objects". In Selected Objects, you will have several options to only restore specific content like e-mail accounts from a selected domain. You have to move all units you want to restore from the left window to the right and confirm with "Restore".


Linux (Debian/Ubuntu): Backup

In this post I want to show you how to create a basic full backup of your file system and how to restore it. A Linux system with root access is required. It does not matter whether it is a Dedicated Server or VPS.

Important: The following commands were tested with Ubuntu 14.04 (64 Bit). They should work with Debian as well. Other distributions like CentOS require a few adjustments here and there.


  1. Create backup
    We use tar with gzip compression to create an archive of the root partition. Special directories will be ignored as they do not contain any relevant data. The MySQL directory won't be archived as well. I get back to that later.We create the backup file in a separate folder which will be also excluded. In this example, I will make use of the Contabo Backup-Space.apt-get install curlftpfs
    curlftpfs USERNAME:PASSWORD@backup.contabo.net /mnt
    cd /mnt
    tar czf rootfs_backup.tar.gz --directory=/ --exclude=dev/* --exclude=proc/* --exclude=run/* --exclude=sys/* --exclude=tmp/* --exclude=var/lib/mysql/* --exclude=mnt/* .

    The backup can also be temporarily created on the server hard disk. The directory in which the archive will be created must be excluded in any case. I strongly recommend to store the archive in an other secure location though.We now have an image of the whole root partition. This image can be used to restore the server in its current state at any time.
  2. Restore backup
    We start the server into the rescue system und login via SSH. It is important to choose the equivalent version, because else the chroot command would fail. In most cases that would be 64 Bit. In this example, the new hard disk is completely empty. Thus, we need to create a new root partition first and also a swap partition if necessary. Use parted to create the partition:parted /dev/vda mklabel msdos
    parted /dev/vda 'mkpart primary 1 -1'
    parted /dev/vda set 1 boot on
    mkfs.ext4 /dev/vda1
    Now we can mount the new root partition and the FTP Backup-Space:mount /dev/vda1 /mnt/custom
    curlftpfs USERNAME:PASSWORD@ /mnt/backup
    And finally start the actual restore process:cd /mnt/custom
    tar xzf /mnt/backup/rootfs_backup.tar.gz
    There are a few modifications necessary to make the system bootable. We change the working environment with chroot:

    mount -o bind /dev /mnt/custom/dev
    mount -o bind /sys /mnt/custom/sys
    mount -t proc /proc /mnt/custom/proc
    chroot /mnt/custom /bin/bash

    The operating system uses UUIDs to identify partitions. Since we created a new root partition we have to replace the old UUID with the new one. We find the new UUID with this command:


    Open /etc/fstab with your favorite text editor, e.g. nano and change the UUID of /. Then fix the GRUB configuration and install the boot loader like this:

    grub-mkconfig > /boot/grub/grub.cfg
    grub-install /dev/vda

    We leave the chroot environment with exit. After a reboot your server server should be running normally again with the backup state.

  3. MySQL exception
    MySQL databases can't be copied directly from the directory while the MySQL server is running. This could result in data corruption. Thus, we use mysqldump here:mysqldump -p --all-databases > db_backup.sqlThis command should be executed before creating the root filesystem backup to include it in the same image. Use the following commands to restore the database backup after the server has been booted normally again for the first time:mysql_install_db
    service mysql start
    mysql < db_backup.sql
    service mysql restart

As you can see a few commands can be enough to not only backup important personal files, but also the complete system including all settings. Regular and reliable backups can prevent long outages and - the real important part - data loss.

Always remember: Data without backup is insignificant data!

Posted by: Tino | Tagged as: , , , 1 Comment

♡ ★ ♡ December 21th – 3 more days to go until Christmas ♡ ★ ♡

data securityChristmas is only a few days away and you still haven't got any ideas for gifts? Have a look on our Advent calendar and I'll promise you, you will find the right christmas present for your sweethearts.

Our today's offer was already to find behind the 10th door but due to big demand we offer it for one more time. It's Christmas and everything is allowed 🙂


For each Dedicated Server you order get 50 GB Backup space for free.

This backup solution will protect you against the risk of data loss.