Skip to main content

Tutorial: How to Back Up Access Server Configuration on Docker

Abstract

Follow these steps on your Docker container to create a backup of your Access Server configuration.

Overview

You have the option to deploy Access Server on a Docker container. This tutorial applies to creating a backup of a configuration for an Access Server Docker deployment.

If you're not using a Docker container, refer to Tutorial: How to Back Up Access Server Configuration.

Access Server stores configurations in SQLite database files. This tutorial covers creating a backup of those files in the Docker Linux host.

  • An Access Server installed on Docker.

  • Access to the Docker Linux host console and the ability to get root access.

Important

The following commands apply to the Access Server configuration stored in SQLite files in the Docker Linux host. If you're using a different database backend, these aren't applicable.

Use the commands below to create configuration file backups while the Access Server container image is running. You don't need to stop the container image for this; it can continue running.

  1. Sign in to the Docker Linux host console and get root privileges.

  2. Run these commands to create Access Server configuration backups:

    which apt > /dev/null 2>&1 && apt -y install sqlite3
    which yum > /dev/null 2>&1 && yum -y install sqlite
    cd /<data_folder>1/etc/db
    [ -e config.db ]&&sqlite3 config.db .dump>../../config.db.bak
    [ -e certs.db ]&&sqlite3 certs.db .dump>../../certs.db.bak
    [ -e userprop.db ]&&sqlite3 userprop.db .dump>../../userprop.db.bak
    [ -e log.db ]&&sqlite3 log.db .dump>../../log.db.bak
    [ -e config_local.db ]&&sqlite3 config_local.db .dump>../../config_local.db.bak
    [ -e cluster.db ]&&sqlite3 cluster.db .dump>../../cluster.db.bak
    [ -e notification.db ]&&sqlite3 notification.db .dump>../../notification.db.bak
    cp ../as.conf ../../as.conf.bak

    1

    Replace <data_folder> with the location for storing Access Server configuration files when you install the Access Server Docker image.

    If you don't know the data folder used by the Access Server container, run this command:

    docker inspect -f '{{ .HostConfig.Binds }}' openvpn-as

    For example:

    root@openvpnas:~# docker inspect -f '{{ .HostConfig.Binds }}' openvpn-as
    [/openvpnas:/openvpn]

    In the above output, the data folder is openvpnas, so this is the folder you need to use in the backup commands like this:

    cd /openvpnas/etc/db
    • After running these commands, you can find the backup files ending in .bak in the <data_folder> directory. The files contain everything unique about your Access Server installation.

You can restore the resulting backup files to another Access Server, including a higher version of Access Server, as we try to maintain backward compatibility.

Refer to Tutorial: How to Restore Access Server Configuration on Docker.

If the configuration becomes completely lost at any point, all currently installed OpenVPN clients will be unable to connect to this server. Unique information stored in the certificates database cannot be recreated. Each installation of Access Server has unique certificates, and if you lose this information without a backup, you must completely reinstall Access Server and the VPN clients.