Backup and restore script files

FTM provides basic backup and restore script files for the persistent volumes and for the ConfigMaps. These scripts work with an NFS server only, but can be used as an example of how to back up and restore your data.

Depending on how you are persisting the custom configuration, you must use the appropriate script file. These script files can be enhanced according to your requirements. The files are available in the FTM artifacts container. For more information about getting the script files from the FTM artifacts container, see Getting the files from the artifacts container for your offering.

Use the following instructions to run the script files.
  1. Get the backup and restore script files that you want to use from the FTM artifacts container.
  2. Copy them to the NFS server where the NFS storage for the FTM persistent volumes is configured.
  3. Run the script, passing it the appropriate values for your deployment.

Use the backup and restore script for the persistent volumes

If you are using the NFS persistent volumes, the persistent volume root folders can be backed up or restored from the /data/<instance-name>/<persistent-volume> location. On the NFS server for the source Red Hat® OpenShift® cluster, you can create a .tar or .zip file to back up the persistent volume folders.

For more information about accessing the path and backing up the files on persistent volumes with other types of storage classes, see the documentation for that storage.

To do the backup or restore operation, run the following script on the NFS server where the NFS storage for the FTM persistent volumes is configured. The user must have write permissions to the path where the backup files are created.
ftm-backup-restore-pv.sh <operation> <nfs-path> <pv-directory> <backup-restore-path>
Where,
operation
Indicates whether to do a backup or restore operation. The valid values are backup or restore.
nfs-path
Path where NFS storage is mounted. For example, /data.
pv-directory
Directory under nfs-path where persistent volumes for the namespace are created. For example, my-ftm-demo-pvs.
backup-restore-path
During the backup operation, it is the path to the folder where the backup file must be created.
During the restore operation, it is the path to the .tar file that was created during the backup step.
Note: The ftm-backup-restore-pv.sh script is useful only if you are using a static persistent volume structure. For dynamically created persistent volumes, you must back up or restore the persistent volumes manually.
The following command shows how to run the persistent volume backup or restore script in the backup mode.
./ftm-backup-restore-pv.sh backup /data my-ftm-demo-pvs /tmp/my-pv-backups
The following command shows how to run the persistent volume backup or restore script in the restore mode.
./ftm-backup-restore-pv.sh restore /data my-ftm-demo-pvs /tmp/my-pv-backups/ftm-demo-2021-04-12-20-09.tar

Use the backup and restore script for the ConfigMaps

You can use the backup and restore configmaps script file that comes with your FTM offering to back up and restore the customization ConfigMaps. The script helps to back up and restore the ConfigMaps of all the Java™ Platform, Enterprise Edition and the Java Platform, Standard Edition components. You can customize it according to your requirements.

To run the backup and restore configmaps script file, do the following steps.
  1. Log in to the Red Hat OpenShift environment where you have the necessary permissions to the namespace where the FTM application is deployed.
  2. Run the following command to either back up or restore the ConfigMaps.
    ftm-backup-restore-config-map.sh <operation> <ftm-namespace> <ftm-instance> <backup-restore-path>
    Where,
    operation
    Indicates whether to do a backup or restore operation. The valid values are backup or restore.
    ftm-namespace
    Name of the Red Hat OpenShift namespace where your FTM offering is deployed.
    ftm-instance
    The name of the instance that has the ConfigMaps that you want to back up or restore. By default, the instance name is the same as the name of the namespace.
    backup-restore-path
    During the backup operation, it is the path to the folder where the backup file must be created.
    During the restore operation, it is the path to the .tar file that was created during the backup step. You must have write permission to this path.
The following command shows how to run the backup and restore configmaps script file in the backup mode.
./ftm-backup-restore-config-map.sh backup ftm-demo ftm-demo /tmp/my-ftm-demo-configmap-backups
The following command shows how to run the backup and restore configmaps script file in the restore mode.
./ftm-backup-restore-config-map.sh restore ftm-demo ftm-demp /tmp/my-ftm-demo-configmap-backups/ftmdemo-2021-05-27-20-09.tar