Back Up and Restore Using the Network File System Server

You can back up the Virtual Appliance data to the Network File System (NFS) server. Follow these steps to back up the Virtual Appliance data:

  1. Set up the NFS server
  2. Configure the NFS parameters
  3. Update Globals File for the NFS Server
  4. Back up the Virtual Appliance Data
  5. Restore the Virtual Appliance Data

Set Up the NFS Server

Follow these steps to install and configure the NFS server on AlmaLinux or Ubuntu:

  1. Run the following commands to install the NFS server.
    AlmaLinux
    dnf install nfs-utils
    mkdir -p /mnt/nfs_share
    chown nobody:nobody /mnt/nfs_share
    chmod 777 -R /mnt/nfs_share/
    Ubuntu
    sudo apt install nfs-kernel-server
    mkdir -p /mnt/nfs_share
    chown nobody:nobody /mnt/nfs_share
    chmod 777 -R /mnt/nfs_share/
  2. Configure the NFS exports.
    /mnt/nfs_share 10.0.203.0/24(rw,sync,no_subtree_check,no_root_squash)
    /mnt/nfs_share 10.0.202.0/24(rw,sync,no_subtree_check,no_root_squash)
  3. Restart the NFS server:
    systemctl restart nfs-server
  4. Verify the NFS server status:
    systemctl status nfs-server

Configure the NFS Parameters on Virtual Appliance

Edit the nfs section in the globals.yaml.gotmplfile with the NFS server details on the required Virtual Appliances:

Sample NFS parameters:

# NFS parameters
nfs:
server: 10.0.203.142
path: /mnt/nfs_share

Configure the NFS Server on the globals.yaml.gotmpl File

  1. Enable the fs section for datastores to back up using the NFS server. See globals.yaml.gotmpl file.
    Elasticsearch
    # Backup config for datastores
    backup:
    elasticsearch:
    fs:
    enabled: true
    storage: 5Gi
    PostgreSQL
    # Backup config for datastores
    backup:
    postgresql:
    fs:
    enabled: true
    repoName: repo3
    storage: 5Gi
    MySQL
    # Backup config for datastores
    backup:
    mysql:
    fs:
    enabled: true
    repoName: repo3
    storage: 5Gi
  2. (Optional) Create a repository to back up the data in the NFS server.
    Note:
    • In a Standard Deployment, Elasticsearch data is stored within the Virtual Appliance. Therefore, the Elasticsearch backup and restore steps are applicable only to the Standard deployment.

    • You can create a repository only for the Elasticsearch backup.

      By default, the globals.yaml.gotmpl file uses the repo3 repository for MySQL and PostgreSQL.

    appdcli run es_backup create-fs-repo virtual-appliance-repo-nfs

Back Up the Virtual Appliance Data in the NFS Server

Snapshots capture the state of the datastore and can be used to restore data. You can store multiple snapshots in a single repository. The following commands stores the snapshots in the virtual-appliance-repo-nfs repository.

Create a snapshot for each datastore:

Elasticsearch
appdcli run es_backup create-snapshot <repo-name> <snapshot-name>
Example
appdcli run es_backup create-snapshot virtual-appliance-repo-nfs es-snapshot
PostgreSQL
appdcli run pg_backup create-snapshot <repo-name>
Example
appdcli run pg_backup create-snapshot repo3
MySQL
appdcli run mysql_backup create-snapshot <repo-name>
Example
appdcli run mysql_backup create-snapshot repo3

Restore Snapshots from the NFS server

Use the snapshots that you have stored in NFS to restore the datastores.

  1. List the snapshots in the repository:
    Elasticsearch
    appdcli run es_backup list-snapshot <repo-name>
    Example
    appdcli run es_backup list-snapshot virtual-appliance-repo-nfs
  2. Restore the datastore by one of the snapshots:
    Elasticsearch
    appdcli run es_backup restore-snapshot <repo-name> <snapshot-name>
    Example
    appdcli run es_backup restore-snapshot virtual-appliance-repo-nfs es_snapshot
    PostgreSQL
    appdcli run pg_backup restore-snapshot <repo-name> <snapshot-name>
    Example
    appdcli run pg_backup restore-snapshot repo3 pg_snapshot
    MySQL
    appdcli run mysql_backup restore-snapshot <repo-name> <snapshot-name>
    Example
    appdcli run mysql_backup restore-snapshot repo3 mysql_snapshot
    Note: Some services may restart during snapshot restoration. To minimize disruption, schedule the restore procedure during planned service downtime.

Delete the Snapshots from the NFS Server

If you no longer require the snapshot, you can delete the snapshot from NFS.

To delete the snapshot:
Elasticsearch
appdcli run es_backup delete-snapshot <repo-name> <snapshot-name>
Example
appdcli run es_backup delete-snapshot virtual-appliance-repo-nfs es_snapshot