UNMS - How to Back Up UNMS


 Overview


This article describes how to back up or migrate UNMS application data.

Table of Contents


  1. Introduction
  2. How to Backup UNMS Application Data
  3. How to Restore UNMS
  4. Related Articles

Introduction


Back to Top

Backing up data is always a good idea, but it is especially important in certain scenarios. For example, when migrating UNMS to a different server; or when testing different features or configurations on UNMS. Performing a backup first is a best practice that allows expertimantation without the danger of losing the settings that a admin is already comfortable with.


How to Backup UNMS Application Data


Back to Top

UNMS data is stored in /home/unms/data on the Docker host, this includes settings, logs, statistics, images, backups, and SSL certificates.

Database Backup - Settings, Logs, and Statistics

Note that backing up or migrating the databases can be done from within the UNMS app. This may be easier for most users. See Settings > Maintenance > Backup. This tool allows users to back up and restore the database instead of moving the /home/unms/data folder.

How to Back Up the UNMS Data Folder

For data backup, first pause the running containers. Go to the directory, where docker-compose.yml is located (probably /home/unms). Then archive the data and save it somewhere safe. As the final step, unpause the containers.

# go to your UNMS home directory
cd /home/unms

#stop docker containers
sudo /home/unms/app/unms-cli stop

# pack the data directory
sudo tar -cvjSf unms-data.tar.bz2 data

# start docker containers
sudo /home/unms/app/unms-cli start

This set of commands will create an archive for all UNMS settings and data. Then it can be moved to another machine or archive.


How to Restore UNMS


Back to Top

In the UNMS user interface go to Settings > Maintenance > Restore and click on the 'Choose file' button. Then select the backup profile that was previously created.

If there is no GUI access for some reason, apply the backup from the command line. Please note that the 'unms-data.tar.bz2' from the example above will be needed.

# go to your UNMS home directory
cd /home/unms

#stop docker containers
sudo /home/unms/app/unms-cli stop

#rename the current data folder
sudo mv data data_old

#create the empty data folder
sudo mkdir data

# extraxt the data directory
sudo tar -xvjSf unms-data.tar.bz2 data

# start docker containers
sudo /home/unms/app/unms-cli start

Related Articles


Back to Top

UNMS - Installation Guide


We're sorry to hear that!