Relax and Recover in VitalPBX: A detailed 5 step guide on how to configure

VitalPBX Relax and Recover Install
Relax-and-Recover is a setup-and-forget Linux bare metal disaster recovery solution. It is easy to set up and requires no maintenance, so there is no excuse for not using it. That is why we have decided to explain how to use it in VitalPBX.

Read our tutorials and guides on how to implement new tools and technologies for your business with VitalPBX here.

One of the great advantages of Relax-and-Recover is that you do not need to turn off the server to perform a full backup of it. It is also possible to exclude certain directories that do not wish to back up.

Here we will explain how to back up to a USB Drive and also create an ISO on an NTS server.

Well, let’s start with the first step that is the installation of Relax-and-Recover on our VitalPBX server.

1.- Install

1.1.- Connect to VitalPBX Server console (You can use Putty or another SSH Client)

1.2.- Install REAR and its dependencies

[root@vitalpbx ~] yum install rear syslinux-extlinux

1.3.- Setup the USB Media
[root@vitalpbx ~] ls /dev/sd (then hit the TAB key twice)

You should see something like this:
sda         sda1       sda2       sda3

1.4.-Next, insert your USB flash drive into the VitalPBX Server and type:
[root@vitalpbx ~] ls /dev/sd (then hit the TAB key).

You should see a new disk
sdb and sdb1

1.5.-Now format the USB Drive. Write Yes and press Enter.  (wait about 3 minutes)
[root@vitalpbx ~] /usr/sbin/rear format /dev/sdb
Write: Yes



The device has been labeled REAR-000 by the format workflow.

1.6.- Now edit the /usr/share/rear/local.conf configuration file with below configuration.
[root@vitalpbx ~] vi /etc/rear/local.conf

### write the rescue initramfs to USB and update the USB bootloader
OUTPUT=USB
#
#### create a backup using the internal NETFS method, using ‘tar’
BACKUP=NETFS
#
#### write both rescue image and backup to the device labeled REAR-000
BACKUP_URL=usb:///dev/disk/by-label/REAR-000
#
#### for exclude recording directory
BACKUP_PROG_EXCLUDE=(“${BACKUP_PROG_EXCLUDE[@]}” ‘var/spool/asterisk/monitor’)

2.- Backup

2.1.- Now proceed to make a full backup.
[root@vitalpbx ~] /usr/sbin/rear -v mkbackup

Now we have the backup on the USB disk. You can have more than one backup on the same USB disk. The amount of backup on the USB disk depends on its capacity.

2.2.- After the backup finished, if you want to test your backup, reboot your system and try to boot from the USB device.

3.- Restore

3.1- Boot your server from the USB disk.

3.2.- Select vitalpbx

3.3.- Select the date that you want to restore and we recommend select “AUTOMATIC RECOVER” option.

3.4.- Wait for the message that you confirm the restore and Type: yes

3.5.- When the restore is finished Type 3 for reboot and do not forget to remove the USB drive.

4.- Backup in NFS Server

4.1.- To make a backup to an NFS Server you need to configure the local.conf file with the following information
[root@vitalpbx ~] vi /etc/rear/local.conf

### write the rescue initramfs to USB and update the USB bootloader
OUTPUT=ISO
#
#### create a backup using the internal NETFS method, using ‘tar’
BACKUP=NETFS
#
#### write both rescue image and backup to the device labeled REAR-000
BACKUP_URL=nfs://NFS_SERVER_IP_ADDRESS/backup
#
#### for exclude recording directory
BACKUP_PROG_EXCLUDE=(“${BACKUP_PROG_EXCLUDE[@]}” ‘var/spool/asterisk/monitor’)

4.2.- Now proceed to make a full backup in the NFS Server.
[root@vitalpbx ~] /usr/sbin/rear -v mkbackup

4.3.- To make a restore medium you need to burn the ISO file in a DVD and restore from it.

5.- Restoring in a different Hardware

ReaR or Relax & Recover is a migration & disaster recovery tool. REAR creates  a bootable image for the running Linux machine & when required same bootable image can be used to recover the system. Same image can be used to restore the OS to different hardware as well & hence REAR can also be used as a migration tool. REAR even detects the change of network cards, disk layouts or storage devices i.e. IDE to SCSI or CCISS.

5.1. Follow steps 3.2 and 3.3.

5.2.- Confirm the change of Ethernet Interface.

5.-3.- Confirm the change of disk mapping table. Use the default “1”.

Note:
The main advantage of making the backup in a USB drive is that you can make more than one backup in the same USB drive. Also, you do not need to burn a DVD or a USB drive to use it.

Learn more about VitalPBX, our services and how we can help you achieve your goals in our official website.

Our Latest Post

How-To
VitalPBX Content

How to Create An OpenAI API KEY

Introduction Obtaining an API Key from OpenAI is a critical step toward unlocking the power of artificial intelligence in your projects, especially if you’re interested

Read More »