UNMS v1 - 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 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.

NOTE:
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 for example photos from the Client section gallery. In order to backup, absolutely everything a whole UNMS 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

# start docker containers
sudo /home/unms/app/unms-cli start
ATTENTION: Automatically create backups should be always the minimal possible size, but manually created ones are not limited in this regard. If the backup file is huge it can take even a couple of hours to apply it. 

Related Articles


Back to Top

UNMS - Installation Guide


We're sorry to hear that!