UNMS - How to Back Up UNMS


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


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 experimentation without the danger of losing carefully polished settings. 

How to Backup UNMS Application Data

Back to Top

For most users, it may be most convenient to use the automatic backup feature available since version 1.0.0. The list of automatic backups is available under Settings > Backups. At the same place, a fresh backup can be initialized in case the automatic one is too old. It is also possible to apply older backup here.

The UNMS backup combines databases from both Network and CRM modules.
User Tip:
In case users would like to use scripts to perform automated actions like downloading a fresh backup to a remote location, it can be achieved by using the powerful UNMS API.

In order to keep the size of automatic backups manageable, only the essential data is stored. This backup doesn't contain stored firmware files, for example. In order to create a backup with absolutely everything on your UNMS system, a data folder can be archived. The folder is located on this path /home/unms/data on the Docker host and includes settings, logs, statistics, images, backups, and SSL certificates. In order to back up this data, 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 this can be done from section Settings > Backups.

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
# run the installation script (make sure to include any optional tag that was used in previous installation)
sudo curl -fsSL https://unms.com/v1/install > /tmp/unms_inst.sh && sudo bash /tmp/unms_inst.sh
Automatically created backups should always be the smallest size possible, but manually created ones are not limited in this regard. If the backup file is very large it can take a couple of hours to apply it. 

Related Articles

Back to Top

UNMS - Installation Guide

Was this article helpful?
6 out of 10 found this helpful
Can't find what you're looking for?
Visit our worldwide community of Ubiquiti experts for more answers
Visit the Ubiquiti Community