Skip to main content
Version: 1.4

SQLServer Backup (Policy)

Performs regular backups of your SQLServer database based on a predefined schedule, ensuring your data is securely archived without manual intervention.

Key features include:

  • Scheduled Backups: Configure the system to execute backups at specific times, reducing the risk of data loss while aligning with your maintenance windows.
  • Multi-Cloud Support: Seamlessly store your backup files in cloud buckets from leading providers such as Azure, GCP, or AWS, offering you flexibility and enhanced resilience.
  • Secure Data Transfer: Employ industry-standard encryption to ensure that your data remains confidential and tamper-proof during both transmission and storage.

Prerequisites

  • SQLServer database asset
  • Workload Identity used for database authentication
  • Storage bucket asset
  • Storage bucket asset credentials

Procedure from web console

  • Navigate to the policy's page: Operations > Policies (or go directly to /home/operations/policies)
  • Click on Create Policy button
  • Select SQLServer backup
  • Fill out the SQLServer backup policy form with the following information:
    • Policy name: Enter a descriptive name for your backup policy
    • The SQLServer asset to backup: Select the SQLServer instance from the dropdown
    • The credential name to access SQLServer: Select the credential bound to the SQLServer asset from the dropdown
    • The database name to backup: Specify the name of the database you want to backup
    • The Bucket asset where backups will be saved: Choose the storage bucket from the dropdown
    • The credential name to access Bucket: Select the credential bound to the Bucket from the dropdown
    • The path inside the bucket where backup is saved: Define the storage path within the bucket
    • The backup schedule in Cron format: Set the backup frequency using cron syntax (e.g., 0 2 * * * for daily at 2 AM)
    • Enable GZIP compression: Check this option to compress backups
    • Storage class for backup volume : Select the storage class to use for the temporary volume (optional)
    • Storage size for backup volume: Specify the disk size (e.g., 1Gi, 5Gi) (optional). Default value: 10Gi
    • Click Next to continue with the policy configuration
  • Select the target cluster where you want to deploy the policy (optional - if not specified, the policy will be deployed to the default cluster)
  • Review the policy configuration summary
  • Click Create Policy to deploy the SQLServer backup policy

Procedure from CLI

Create a YAML file with the policy configuration:

apiVersion: operations.resiliency.io/v1alpha1
kind: Policy
metadata:
name: <policy-name>
namespace: resiliency-system
spec:
templateName: SQLServer-backup
params:
- name: sqlserver-asset
value: <sqlserver-asset-id>
- name: sqlserver-database
value: <database-name>
- name: bucket-asset
value: <bucket-asset-id>
- name: bucket-path
value: "<path-in-bucket>"
- name: pvc-storage-class
value: <storage-class-name>
- name: pvc-size
value: "<disk-size-in-gi>"
- name: schedule
value: "<cron-schedule>"
- name: use-gzip
value: <true|false>
- name: bucket-credential
value: <bucket-credential-name>
- name: SQLServer-credential
value: <SQLServer-credential-name>
placement:
clusterName: <target-cluster-id>
createNamespace: true
credentialName: <cluster-credential-name>
suspended: false

Apply the policy to the cluster:

kubectl apply -f sqlserver-backup-policy.yaml