Backup a data service
This topic explains how you can backup a deployed data service in PDS.
You can only backup the Cassandra, Consul, Couchbase, Elasticsearch, MongoDB Enterprise, MySQL, PostgreSQL, and Redis data services.
Moreover, you can backup only one deployment at a time. Triggering multiple backups at once can cause the jobs to time out.
Prerequisites
-
PDS account Admin privileges
-
A deployed data service
-
A backup target
PDS provides the following backup types for each deployed data service:
-
Ad-hoc: manually back up a data service whenever you want to.
-
Scheduled: automatically run your backup jobs at a specific time.
Ad-hoc backup
To perform an ad-hoc backup:
-
From the Data Services Dashboard, expand a data service that is available for backup.
-
In the data service details, click on Backup:
-
From the Take Ad-hoc Backup dialog box → Backup Target dropdown, select the backup target where you want to backup the data service.
For more information about configuring a backup target, refer to Configure backup targets. -
Select the Backup button.
You can also select the Backup button from the Deployment details page, select the backup target and backup the data service:
Schedule a backup
You can schedule a data service backup while:
-
deploying a data service
-
editing a deployment configurations
Schedule a backup during deployment
To schedule a data service backup during the deployment process:
-
In the Deploy dialog box, specify all configurations for the data service you want to deploy. For more information about the Deploy dialog box parameters, refer to the Deploy a data service topic.
-
In Backup dropdown, select a backup schedule.
-
Select the Deploy button.
Schedule a backup while editing a deployment configuration
To schedule a data service backup while editing a data service deployment:
-
In the deployment dashboard, select Edit.
-
In the Edit Deployment dialog box, modify the configurations that you already specified while deploying a data service.
-
In Backup dropdown, select a backup schedule.
-
Select the Apply button.
Delete a backup
To delete a backup:
-
In the data service deployment dashboard -> the backup job you want to delete, select the vertical ellipsis button and then select Delete.
-
In the Delete Backup Job window, select Delete.
If the deployment status is Disconnected, then a backup is deleted only from the source location. However, data will remain in the target cluster due to its unavailability.
To delete data that persist in the target cluster:
-
List all backups within the namespace whose names include the deployment name:
kubectl get backups -n <namespace> | grep <deployment_name>
-
Search for the specific backup within the list to delete it:
kubectl delete backups -n <namespace> <backup_name>
-
Deleting a backup also results in the corresponding backup jobs being removed. To confirm their deletion, perform a 'grep' operation using the backup name:
kubectl get backupjobs -n <namespace> | grep <backup_name>
If they are not deleted, then run the delete operation on the backup jobs:
kubectl delete backupjobs -n <namespace> <backup_job_name>