Skip to main content
Version: 7.2405.x.x LTS

Backup and recovery

Instances of Nevis product or components can be stored into archive files (tar) by using the "inst config backup" command of each individual instance. These files can be used to recreate instances in case a server has to be reinstalled from scratch.

Full backup

The shell script /root/tools/backup.sh can be used to create a compressed tar archive of all persistent data (all configuration files of the server), except the log files.

Sample script for remote backup via ssh

#!/bin/sh
set -e
set -u
SERVER=appliance.adnovum.ch

#create a backup
FILE=`ssh root@${SERVER} "/root/tools/backup.sh"`

#transfer the file to the current working directory
scp root@${SERVER}:${FILE} .

#remove the backup file from the server
ssh root@${SERVER} "rm ${FILE}"
#delete backup files (e.g., older than one month)
for
oldF in `find . -mtime +30 | grep backup_${SERVER}`; do
rm $oldF
done

The file can be used for disaster recovery purposes:

  • A single file can be restored in case the file or its content has been lost. Example restoring the /etc/hosts file:

    tar xfz backup_appliance.zh.adnovum.ch_20110912201809.tgz etc/hosts
    cp etc/hosts /etc/hosts
  • The whole server can be recovered by a reinstallation of the nevisAppliance image. You can then restore all configuration files by extracting the backup archive in the root directory and activate them by a server reboot. Example for restoring the configuration:

    cd /
    tar xfz backup_appliance.zh.adnovum.ch_20110912201809.tgz
    shutdown -r now

Use the /tools/dbbackup.sh script to back up your database on a database appliance.

Couchbase Deprecated: Use the /tools/cbbackup.sh script to back up your Couchbase server's database.

Recover the boot partition

The boot partition can be recovered when booting the server from the nevisAppliance installation CDROM. Log in as user "root" and execute the create-boot.sh script to re-initialize the boot partition.

Console output when recovering the boot partition

Afterwards, you can reboot your server from its disk and re-install the OS image as shown in the chapter Software updates.

Factory reset

You may want to delete everything except the network settings and the user's home directories within a nevisAppliance server to restore the server to its initial installation state. You can achieve this by creating the /etc/factory.reset file and then rebooting the server.

Example

touch /etc/factory.reset
shutdown -r now