KB 2558: Manual and automatic backup from the administration interface
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:
- Click on Add a NAS.
- In the Label field, specify: backup-local.
- In the Description field, specify: local backups.
- Log on as root to the Olfeo console via an SSH connection.
- 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
- Then enter /mnt/bckp-loc in Location.
- 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.
- Log on as root to the Olfeo console via an SSH connection.
- 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
- In the case of a CIFS mounting point :
- root@olfeo:~# echo " username=james " > /root/.smbcredentials && echo " password=mypassw0rd " >> /root/.smbcredentials
- root@olfeo:~# apt-get install smbfs
- root@olfeo:~# mount /mnt/bckp-loc
- 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
- In the case of an NFS mount point :
- 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.
- In the Setup > Backup > Tasks page, click on Create backup task.
- In the Label field, enter: backup-full.
- In the Description field, specify: full backup.
- Check all modules.
- Select Destination from the drop-down list: backup-local.
- 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.
- Click on the Validate button.
- 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
- In the Setup > Backup > Backup list page, in the Action column, click on Restore toopen the Restore settings window.
- 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