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:

Set Up the NFS Server

This section considers AlmaLinux OS as an example OS to install the NFS server. Follow these steps to install and configure the NFS server:

  1. Run the following commands to install the NFS server.
    dnf install nfs-utils
    mkdir -p /mnt/nfs_share
    chown nobody:nobody /mnt/nfs_share
    chmod 777 -R /mnt/nfs_share/
    CODE
  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)
    CODE
  3. Restart the NFS server:
    systemctl restart nfs-server
    CODE
  4. Verify the NFS server status:
    systemctl status nfs-server
    CODE

Configure the NFS Parameters on Virtual Appliance

Edit the globals.yaml.gotmpl file with the NFS server details:

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

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

  1. Create a repository to back up the data in the NFS server.

    You can create 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
    CODE
  2. Enable the fs section for datastores to back up using the NFS server. See globals.yaml.gotmpl file.
    # Backup config for datastores
    backup:
      elasticsearch:
        fs:
          enabled: true
          storage: 5Gi
    CODE


    # Backup config for datastores
    backup:
      postgresql:
        fs:
          enabled: true
          repoName: repo3
          storage: 5Gipg-
    CODE



    # Backup config for datastores
    backup:  
      mysql:
        fs:
          enabled: true
          repoName: repo3
          storage: 5Gi
    CODE



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:

appdcli run es_backup create-snapshot <repo-name> <snapshot-name>
CODE

Example

appdcli run es_backup create-snapshot virtual-appliance-repo-nfs es-snapshot
CODE
appdcli run pg_backup create-snapshot <repo-name> <snapshot-name>
CODE

Example

appdcli run pg_backup create-snapshot repo3 pg-snapshot
CODE



appdcli run mysql_backup create-snapshot <repo-name> <snapshot-name>
CODE

Example

appdcli run mysql_backup create-snapshot repo3 mysql-snapshot
CODE



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:
    appdcli run es_backup list-snapshot <repo-name>
    CODE

    Example

    appdcli run es_backup list-snapshot virtual-appliance-repo-nfs 
    CODE
    appdcli run pg_backup list-snapshot <repo-name>
    CODE

    Example

    appdcli run pg_backup list-snapshot repo3
    CODE


    appdcli run mysql_backup list-snapshot <repo-name>
    CODE

    Example

    appdcli run mysql_backup list-snapshot repo3
    CODE


  2. Restore the datastore by one of the snapshots:
    appdcli run es_backup restore-snapshot <repo-name> <snapshot-name>
    CODE

    Example

    appdcli run es_backup restore-snapshot virtual-appliance-repo-nfs es_snapshot
    CODE
    appdcli run pg_backup restore-snapshot <repo-name>
    CODE

    Example

    appdcli run pg_backup restore-snapshot repo3 pg_snapshot
    CODE


    appdcli run mysql_backup restore-snapshot <repo-name>
    CODE

    Example

    appdcli run mysql_backup restore-snapshot repo3 mysql_snapshot
    CODE


Delete the Snapshots from the NFS Server

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


appdcli run es_backup delete-snapshot <repo-name> <snapshot-name>
CODE

Example

appdcli run es_backup delete-snapshot virtual-appliance-repo-nfs es_snapshot
CODE
appdcli run pg_backup delete-snapshot <repo-name>
CODE

Example

appdcli run pg_backup delete-snapshot repo3 pg_snapshot
CODE


appdcli run mysql_backup delete-snapshot <repo-name>
CODE

Example

appdcli run mysql_backup delete-snapshot repo3 mysql_snapshot
CODE