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:

Note: Set up a separate NFS server outside Virtual Appliance.
  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.
    Specify the Virtual Appliance's network IP addresses that mounts the nfs_share on these servers.
    /mnt/nfs_share <IP-address-1>/24(rw,sync,no_subtree_check,no_root_squash)
    /mnt/nfs_share <IP-address-2>/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

    Ensure that the NFS server status displays success.

    Sample Output:
    nfs-server.service - NFS server and services
         Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
        Drop-In: /run/systemd/generator/nfs-server.service.d
                 └─order-with-mounts.conf
         Active: active (exited) since Sun 2025-11-02 18:23:48 UTC; 1 day 19h ago
        Process: 894 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
        Process: 901 ExecStart=/usr/sbin/rpc.nfsd (code=exited, status=0/SUCCESS)
       Main PID: 901 (code=exited, status=0/SUCCESS)
            CPU: 5ms
    
    Nov 02 18:23:48 appdva-test9-vm177 systemd[1]: Starting NFS server and services...
    Nov 02 18:23:48 appdva-test9-vm177 systemd[1]: Finished NFS server and services.
    

Configure the NFS Parameters on Virtual Appliance

Edit the globals.yaml.gotmplfile with the NFS server details:

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:
    • Only in Standard Deployment, the Elasticsearch data resides in Virtual Appliance. Therefore, backup and restore steps apply only for 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.

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