Back Up and Recovery

Follow the steps in this guide to back up and restore the essential system files for the NGINX Management Suite platform and modules.


This documentation applies to NGINX Management Suite Instance Manager 2.7.0 and later.


Overview

NGINX Management Suite includes backup.sh and restore.sh scripts in /etc/nms/scripts, which you can run to back up and restore the configuration files, secrets, and databases used by the NGINX Management Suite platform.

Additionally, to back up and restore data for specific modules, such as API Connectivity Manager, you can edit the backup.sh and restore.sh scripts and uncomment the commands in the relevant sections.

For example, to back up and restore data for API Connectivity Manager, uncomment the following lines:

backup.sh: enable backups for API Connectivity Manager
## Back up API Connectivity Manager
# Uncomment the following line to back up API Connectivity Manager.
./backup-acm.sh
restore.sh: enable restore for API Connectivity Manager
## Restore the API Connectivity Manager database.
# Uncomment the following line to restore API Connectivity Manager.
./restore-acm.sh

Before You Begin

To complete the instructions in this guide, you need the following:

  • An installed version of Instance Manager
  • (optional) An installed version of API Connectivity Manager

Make Scripts Executable

To run the backup and restore scripts, you need to set their permissions to make them executable.

  1. Change to the directory where the scripts are located:

    cd /etc/nms/scripts
    
  2. Make the scripts executable:

    sudo chmod +x backup.sh
    sudo chmod +x restore.sh
    sudo chmod +x backup-acm.sh
    sudo chmod +x restore-acm.sh
    sudo chmod +x backup-adc.sh
    sudo chmod +x restore-adc.sh
    

Back Up NGINX Management Suite

To back up NGINX Management Suite:

  1. Open a secure shell (SSH) connection to the NGINX Management Suite host and log in.

  2. To back up NGINX Management Suite, run the following commands:

    cd /etc/nms/scripts
    sudo ./backup.sh
    

    The backup is saved to a tarball file similar to the following example: /tmp/nms-backup-<DATETIME>.tgz


Restore NGINX Management Suite

To restore NGINX Management Suite:

  1. Open a secure shell (SSH) connection to the NGINX Management Suite host and log in.

  2. To restore NGINX Management Suite, run the following commands:

    cd /etc/nms/scripts
    sudo ./restore.sh /tmp/nms-backup-<DATETIME>.tgz
    

Warm Sync

To create a warm standby system, that is, a redundant system on standby that’s identical to the primary system, you can run the warm-sync.sh script on a schedule (for example, with cron).

The warm-sync.sh scripts performs the following actions:

  • Creates a backup on the current host
  • Copies the backup file to the target host
  • Restores the backup on the target host

To create a warm standby system, take the following steps:

  1. Open a secure shell (SSH) connection to the primary NGINX Management Suite host you want to back up and log in.

  2. To perform a warm synch, run the following command:

    sudo ./warm-sync.sh <target-host>.com
    

    For example:

    sudo ./warm-sync.sh warm-sync-host.com
    

ClickHouse

ClickHouse supports backup and restore on versions greater than v22.

For instructions on how to back up and restore the ClickHouse database, please refer to ClickHouse’s documentation.

To check your ClickHouse version, run the following command:

clickhouse-server --version

Troubleshooting

The backup and recovery scripts are provided for reference, and you may need to edit them to fit your deployment’s needs.

The backup and recovery scripts assume that the target host has the same configuration as the source host; for example, the IP addresses and TLS certificates are assumed to match for both hosts. If this is not the case, you must modify the scripts to suit your deployment accordingly.