PostgreSQL Restore
Prerequisites
- PostgreSQL database asset
- PostgreSQL credentials
- Storage bucket asset
- Storage bucket asset credentials
Procedure from web console
- Navigate to the tasks page: Operations > Tasks (or go directly to
/home/operations/tasks) - Click on Create Task button
- Select PostgreSQL restore
- Fill out the PostgreSQL restore task form with the following information:
- Task name: Enter a descriptive name for your restore task
- The PostgreSQL asset to restore to: Select the target PostgreSQL instance from the dropdown
- PostgreSQL credential: Select the credential to access the PostgreSQL instance
- The database name to restore: Specify the name of the database you want to restore
- The version for PostgreSQL client version: Specify the PostgreSQL client version to use (optional)
- The opts for PostgreSQL restore: Configure additional restore options (optional)
- The Bucket asset where backups are stored: Choose the storage bucket containing the backup from the dropdown
- Bucket credential: Select the credential to access the storage bucket
- The restore path: Define the path within the bucket where the backup files are located
- Click Next to continue with the task configuration
- Select the target cluster where you want to execute the restore task (optional - if not specified, the task will run on the default cluster)
- Review the task configuration summary
- Click Create Task to execute the PostgreSQL restore task
Procedure from CLI
Create a YAML file with the PostgreSQL restore task configuration:
apiVersion: operations.resiliency.io/v1alpha1
kind: Task
metadata:
name: <task-name>
namespace: resiliency-system
spec:
placement:
clusterName: <target-cluster-id>
credentialName: <cluster-credential-name>
templateRef:
templateName: postgresql-restore
params:
- name: postgresql-asset
value: <postgresql-asset-id>
- name: postgresql-database
value: <database-name>
- name: postgresql-cli-version
value: "<client-version>"
- name: postgresql-restore-opts
value: "<restore-options>"
- name: bucket-asset
value: <bucket-asset-id>
- name: restore-path
value: <path-to-backup-in-bucket>
- name: postgresql-credential
value: <postgresql-credential-name>
- name: bucket-credential
value: <bucket-credential-name>
Apply the task to the cluster
kubectl apply -f postgresql-restore-task.yaml
Note:
- Replace the placeholder values (
<task-name>,<postgresql-asset-id>, etc.) with your actual configuration values - This task will perform a one-time PostgreSQL restore operation from the specified backup path
- The restore-path should point to the location of your backup files within the bucket