BLOG

KB No. 2558: Manual and automatic backup from the administration interface

Objective

How to perform a manual backup or schedule an automatic backup of the configuration from the Olfeo solution's administration interface.

Background

We will define the backup mount point for the Olfeo solution. First, we will create the local directory /mnt/bckp-loc/, which will contain all the manual and/or automatic backup folders. We will then see how to mount CIFS/SAMBA and NFS shares.

Steps

Step 1

Settings menu > Backup > Destinations:

  1. Click Add a NAS.
  2. Enter backup-local in the Label field.
  3. Enter " local backups" in the Description field.
  4. Log in with the root user on the Olfeo console via an SSH connection.
  5. Create a directory bckp-loc :
    • If the solution is on a virtual host: root@olfeo:~# mkdir -p /opt/olfeo5/chroot/mnt/bckp-loc
    • If the solution is on an Olfeo box appliance: root@olfeo:~# mkdir -p /mnt/bckp-loc
  6. Then enter the following in Location: /mnt/bckp-loc.
  7. Click on Confirm.

Step 2

From this point on, it is possible to perform the backup on the local machine, but we strongly recommend the following procedure. We will now mount the remote Windows CIFS/SAMBA file system or the remote Linux NFS file system on the local mount point /mnt/bckp-loc/ of the Olfeo solution that we previously created, which will contain all the manual and/or automatic backup folders.

  1. Log in with the root user on the Olfeo console via an SSH connection.
  2. Edit the file /etc/fstab, as applicable:
    • In the case of a CIFS mount point:
      root@olfeo:~# echo "# CIFS mount point for Olfeo backups" >> /etc/fstab
    • If the solution is on a virtual host:
      root@olfeo:~# echo "//REMOTE-CIFS-SRV/ /opt/olfeo5/chroot/mnt/bckp-loc cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777,auto,noserverino 0 0  " >> /etc/fstab
    • If the solution is on an Olfeo box appliance:
      root@olfeo:~# echo "//REMOTE-CIFS-SERVER/ /mnt/bckp-loc cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777,auto,noserverino 0 0" >> /etc/fstab
  3. root@olfeo:~# echo "username=james" > /root/.smbcredentials && echo "password=mypassw0rd" >> /root/.smbcredentials
  4. root@olfeo:~# apt-get install smbfs
  5. root@olfeo:~# mount /mnt/bckp-loc
  6. Depending on the case:
    • In the case of an NFS mount point:

      root@olfeo:~# echo "# NFS mount point for Olfeo backups" >> /etc/fstab

    • If the solution is on a virtual host: root@olfeo:~# echo "//REMOTE-NFS-SERVER:DIRECTORY/ /opt/olfeo5/chroot/mnt/bckp-loc/ nfs 0 0" >> /etc/fstab
    • If the solution is on an Olfeo box appliance:
      • root@olfeo:~# echo "//REMOTE-SRV-NFS:DIRECTORY/ /mnt/bckp-loc/ nfs 0 0" >> /etc/fstab
      • root@olfeo:~# apt-get install nfs-client nfs-common
      • root@olfeo:~# mount /mnt/bckp-loc
  7. Click on Confirm.

Step 3

We will define a full backup task called backup-full that can be run "on the fly," manually or automatically, without interrupting services. This backup task will be based on the local directory /mnt/bckp-loc/ of the Olfeo solution.

  1. On the Settings > Backup > Tasks page, click Create a backup task.
  2. Enter backup-full in the Label field.
  3. Enter " full backup" in the Description field.
  4. Check all modules.
  5. Select from the Destination drop-down list: backup-local.
  6. In the Schedule area, check the *None* box for a manual backup without scheduling, or for an automatic backup, schedule a daily, weekly, or monthly backup using UTC time.In all cases, it is possible to set up a backup retention rotation by checking and specifying in the Cleanup field to keep only the last X backups.
  7. Click on the Validate button.
  8. In the Action column, click Run to start the manual backup.

A manual backup on your local machine has generated a backups folder containing the entire configuration in a subfolder named according to the date and time of the backup. This backup can now be used during a restore on the machine by following the procedure below:

Restoration procedure

From the administration interface

  1. On the Settings > Backup > Backup List page, in the Action column, click Restoreto open the Restore settings window.
  2. Click on Validate to start the restoration, which will be followed by the restart of the Olfeo solution. The backup files are located on the machine in the following path:

    /opt/olfeo5/chroot/mnt/bckp-loc/backups/YYYYMMDD_hh-mm/

    For example:

    /opt/olfeo5/chroot/mnt/bckp-loc/backups/20130909_11:59/

From the command line, if the target Olfeo solution is in the same version.

chroot /opt/olfeo5/chroot
/opt/olfeo5/bin/restore /mnt/bckp-loc/backups/20130909_11-59/

From the command line, if the version of the Olfeo solution differs and is higher than 95.014

chroot /opt/olfeo5/chroot
/opt/olfeo5/bin/cliadmin reset (note: this command resets the Olfeo databases)
/opt/olfeo5/bin/restore /mnt/bckp-loc/backups/20130909_11-59