~fkooman/vpn-documentation

ref: 9d22c514a9f893498f2c8bf8688d2e8a6c9adb4d vpn-documentation/backup.sh -rwxr-xr-x 916 bytes
9d22c514François Kooman hopefully fix IPv6 when deploying on VM using RA 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

#
# Backup
# 
# NOTE: this script only backs-up the VPN configuration and data, NOT things
# like SAML configuration, installed LDAP certificates and/or network 
# configuration.
#
# This is only for the installations performed with the "deploy_${DIST}.sh" 
# scripts for the various platforms.

TMP_DIR=$(mktemp -d)
DATETIME=$(date +%Y%m%d%H%M%S)

tar --selinux -cpJf "${TMP_DIR}/backup-${DATETIME}.tar.xz" \
    /etc/vpn-user-portal \
    /etc/vpn-server-api \
    /etc/vpn-server-node \
    /var/lib/vpn-user-portal \
    /var/lib/vpn-server-api

echo "${TMP_DIR}/backup-${DATETIME}.tar.xz"

#
# Restore (as root)
#
# first run the "deploy_${DIST}.sh" script, same as for a new deploy
#
# cd / && tar --selinux -xJf <file.tar.xz>
# vpn-server-node-server-config
#
# enable all the OpenVPN processes (systemctl) if necessary and start them!
# reboot server to make sure everything comes up as expected!