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.
- Get the backup and restore script files that you want to use from the FTM artifacts container.
- Copy them to the NFS server where the NFS storage for the FTM persistent volumes is configured.
- 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.
ftm-backup-restore-pv.sh <operation> <nfs-path> <pv-directory> <backup-restore-path>
- operation
- Indicates whether to do a backup or restore operation. The valid values are
backuporrestore. - 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.
./ftm-backup-restore-pv.sh backup /data my-ftm-demo-pvs /tmp/my-pv-backups./ftm-backup-restore-pv.sh restore /data my-ftm-demo-pvs /tmp/my-pv-backups/ftm-demo-2021-04-12-20-09.tarUse 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.
- Log in to the Red Hat OpenShift environment where you have the necessary permissions to the namespace where the FTM application is deployed.
- 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
backuporrestore. - 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.
./ftm-backup-restore-config-map.sh backup ftm-demo ftm-demo /tmp/my-ftm-demo-configmap-backups./ftm-backup-restore-config-map.sh restore ftm-demo ftm-demp /tmp/my-ftm-demo-configmap-backups/ftmdemo-2021-05-27-20-09.tar