Blog
The Blog

KB 2558: Manual and automatic backup from the administration interface

KB Olfeo On-Premise
July 4, 2023

Objective

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

Context

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

Steps

Step 1

Setup menu > Backup > Destinations:

  1. Click on Add a NAS.
  2. In the Label field, specify: backup-local.
  3. In the Description field, specify: local backups.
  4. Log on as root to 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 /mnt/bckp-loc in Location.
  7. Click on Validate.

Step 2

From this point, it is possible to perform the backup on the local machine, but we strongly recommend the following procedure. We're now going to 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 we created earlier, which will contain all the manual and/or automatic backup folders.

  1. Log on as root to the Olfeo console via an SSH connection.
  2. Edit file /etc/fstabdepending on the case :
    • In the case of a CIFS mounting point :
      root@olfeo:~# echo " # CIFS mount point for Olfeo backups " >> /etc/fstab
    • If the solution is on a virtual host :
      root@olfeo:~# echo " //SRV-CIFS-DISTANT/ /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 " //SRV-CIFS-DISTANT/ /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. As appropriate :
    • 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 " //SRV-NFS-DISTANT:DIRECTORY/ /opt/olfeo5/chroot/mnt/bckp-loc/ nfs 0 0 " >> /etc/fstab
    • If the solution is on an Olfeo box appliance :
      • root@olfeo:~# echo " //SRV-NFS-DISTANT: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 Validate.

Step 3

We're going to define a full backup task called backup-full, which can be run manually or automatically, without interrupting services. This backup job will be based on the local /mnt/bckp-loc/ directory of the Olfeo solution.

  1. In the Setup > Backup > Tasks page, click on Create backup task.
  2. In the Label field, enter: backup-full.
  3. In the Description field, specify: full backup.
  4. Check all modules.
  5. Select Destination from the drop-down list: backup-local.
  6. In the Scheduling field, check the *None* box for a manual backup without scheduling, or for an automatic backup, schedule a daily, weekly or monthly backup via UTC time. In all cases, you can set up a backup retention rotation by checking and specifying in the Cleaning field to retain only the last X backups.
  7. Click on the Validate button.
  8. In the Action column, click on Execute to start manual backup.

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

Restoration procedure

From the administration interface

  1. In the Setup > Backup > Backup list page, in the Action column, click on Restore toopen the Restore settings window.
  2. Click on Confirm 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 (this command resets Olfeo databases)
/opt/olfeo5/bin/restore /mnt/bckp-loc/backups/20130909_11-59