Skip to main content

Database Backup Policies

Overview

Database Backup Policies provide automated, offsite backups for managed databases with S3-compatible storage, incremental backups, and point-in-time recovery (PITR). Create reusable policies with S3 credentials, scheduling preferences, and retention settings, then attach one or more databases to each policy.

Key capabilities:

  • S3-compatible storage -- Backups stream directly to any S3-compatible storage (AWS S3, MinIO, Wasabi, etc.)
  • Engine-specific backups -- Uses the best backup tools for each engine (MySQL, MariaDB, PostgreSQL)
  • Incremental backups -- Only back up changes since the last full backup, reducing storage and duration
  • Point-in-time recovery (PITR) -- Recover to any second within the retention window using transaction log archiving
  • AES-256 encryption -- Optional client-side encryption before upload
  • Automatic failure handling -- Three consecutive failures pause the policy and notify you by email
  • Reusable policies -- A single policy can be attached to multiple databases

Prerequisites

Before creating a backup policy:

  1. An S3-compatible storage bucket must be provisioned with valid access credentials (access key and secret key)
  2. At least one managed database must exist in Active status
  3. The S3 endpoint must be reachable from the database over HTTPS
warning

S3 credentials require s3:PutObject, s3:GetObject, s3:DeleteObject, and s3:ListBucket permissions on the target bucket. Insufficient permissions will cause backup failures.


Creating a Backup Policy

User Panel

  1. Navigate to Databases > Backup Policies in the sidebar
  2. Click Add Policy
  3. Fill in the policy configuration:

General:

FieldDescription
NameA descriptive name for the policy (e.g., "Production Daily")

S3 Configuration:

FieldDescription
S3 EndpointHostname of the S3-compatible endpoint (e.g., s3.us-east-1.amazonaws.com or minio.example.com)
S3 BucketTarget bucket name
S3 RegionBucket region (e.g., us-east-1)
S3 Access KeyIAM access key with read/write/delete permissions on the bucket
S3 Secret KeyCorresponding secret key
S3 Path PrefixOptional prefix within the bucket (e.g., backups/production)
tip

Click Test Connection to verify S3 credentials before saving.

Schedule:

FieldValuesDescription
Full Backup FrequencyDaily, WeeklyHow often a full backup runs
Full Backup TimeHH:MM (UTC)Time of day to start full backups
Full Backup DaySunday -- SaturdayDay of week for weekly schedules
Incremental FrequencyNone, 1h, 2h, 4h, 6h, 12hInterval between incremental backups

PITR:

FieldDescription
PITR EnabledToggle point-in-time recovery on or off

When PITR is enabled, transaction log archiving (binary logs for MySQL/MariaDB, WAL archiving for PostgreSQL) is automatically configured when a database is attached to the policy. This allows recovery to any point in time within the retention window.

Retention:

FieldDefaultDescription
Retain Full Backups7Number of full backups to keep
Retain Incrementals30 daysDays to retain incremental backups
Retain PITR72 hoursHours to retain PITR archives

Encryption:

FieldDescription
Encryption EnabledToggle AES-256 encryption for all backups (default: enabled)
info

When encryption is enabled, the system auto-generates an encryption key that is stored securely. All backups are encrypted before upload.

  1. Click Create

Admin Panel

  1. Navigate to Managed Databases > Backup Policies
  2. Click Add Policy
  3. Select a User who will own the policy
  4. Fill in the same configuration sections as the user panel
  5. Click Create

Admins can view and manage all backup policies across all users.


Policy Detail Page

The policy detail page shows two sections:

Policy Summary

  • Name and Status (Active, Paused, Error, or Validating)
  • S3 Configuration -- Endpoint, bucket, region, and path prefix
  • Credentials Verified -- Timestamp of last successful S3 validation
  • Schedule -- Full backup frequency, time, and day (if weekly); incremental frequency
  • Retention Settings -- Full backup count, incremental days, PITR hours
  • Encryption -- Whether backups are encrypted
  • Consecutive Failures -- Warning shown if failures have occurred

Attached Databases

A table listing all databases attached to this policy:

ColumnDescription
Database NameName of the managed database
EngineMySQL, MariaDB, or PostgreSQL
HostDatabase hostname
Last Full BackupTimestamp of most recent full backup
Last IncrementalTimestamp of most recent incremental backup
PITR StatusActive, Configuring, Error, or -- if disabled
ActionsDetach button

Attaching Databases to a Policy

A database can be attached to exactly one backup policy at a time. Only primary databases in Active status can be attached.

From the Policy Detail Page

  1. Open the policy detail page
  2. In the Attached Databases section, select a database from the dropdown
  3. Click Attach

What Happens on Attach

When a database is attached:

  1. Backup tools are installed -- The required backup utilities are automatically installed on the database
  2. PITR is configured (if enabled on the policy) -- Transaction log archiving is set up for the database engine
  3. Initial full backup -- An immediate full backup runs to establish a baseline
info

The attach process may take a few minutes to complete, as it involves installing tools, configuring PITR, and running the initial full backup.

Detaching a Database

Click the Detach button next to the database on the policy detail page. PITR configuration is disabled on detach. Existing backups in S3 are not deleted.


Backup Types

Full Backups

Full backups capture the entire database state. They serve as the base for incremental chains and PITR recovery.

Incremental Backups

Incremental backups capture only changes since the last full backup, significantly reducing backup size and duration. If no parent full backup exists (e.g., it was deleted by retention cleanup), the system automatically falls back to a full backup.

PITR Archives

PITR archives are the continuous stream of transaction logs that enable recovery to any point in time:

  • MySQL/MariaDB -- Binary logs are archived during each incremental backup job
  • PostgreSQL -- WAL segments are archived continuously as they are generated

Backup Source Selection

The system automatically selects the best database to back up from:

  1. If the database has a healthy replica, the replica is used as the backup source to avoid performance impact on the primary
  2. If no healthy replica is available, the primary is used
tip

This is fully automatic -- when a replica is available, backups run against the replica to minimize load on the primary.


Scheduling

Backups are scheduled automatically based on the policy configuration:

  • Full backups run at the configured time and frequency (daily or weekly)
  • Incremental backups run at the configured interval between full backups
  • A database with a pending or in-progress backup is skipped to prevent overlap

Retention and Cleanup

Retention rules are enforced automatically on a daily basis:

RuleDescription
Full backup countKeeps the most recent N full backups, deletes older ones
Incremental ageDeletes incrementals older than the configured retention period
PITR archive ageDeletes PITR archives older than the configured retention period
Orphaned incrementalsDeletes incrementals whose parent full backup no longer exists
warning

When a full backup is deleted, all of its child incremental backups and associated PITR archives are also deleted from S3.


Restore Operations

Restore from Backup

Restore a database from a specific completed backup (full or incremental).

  1. On the database detail page, go to the Backups tab
  2. Click Restore next to the desired backup
  3. Confirm the action

For incremental restores, the system automatically applies the full backup plus each incremental in sequence.

Point-in-Time Recovery (PITR)

Restore a database to a specific timestamp within the PITR recovery window.

  1. On the database detail page, click Restore PITR
  2. Select the target date and time (the available recovery window is displayed)
  3. Click Restore

The system finds the most recent full backup before the target time, applies any incrementals, then replays transaction logs up to the exact target timestamp.

danger

Restoring a database overwrites all current data. This operation cannot be undone. Consider creating a manual backup before performing a restore.


Manual Backup

Trigger an on-demand full backup from the policy detail page or the database manage page by clicking Manual Backup. A manual backup is rejected if a backup is already pending or in progress.


Failure Handling

EventAction
Single backup failureBackup marked as failed, failure counter incremented, email notification sent
3 consecutive failuresPolicy paused, new backups stop scheduling, email notification sent
Backup succeedsFailure counter resets, policy restored to active if it was paused
PITR gap detectedPITR status set to error, email notification sent
Backup source becomes unavailableNext backup auto-selects a different source, email notification sent

The policy detail page displays a warning banner when failures have occurred, showing the failure count and the last error message. A Reset Failures button allows clearing the counter and restoring the policy to Active status.


Email Notifications

Four email notifications are sent for backup-related events:

NotificationTrigger
Backup FailedEach individual backup failure
Policy PausedPolicy reaches 3 consecutive failures and is paused
PITR Gap DetectedTransaction log continuity is broken
Backup Source ChangedBackup source switched between replica and primary

Admin vs. User Capabilities

CapabilityAdminUser
Create backup policiesYes (for any user)Yes (own only)
Edit/delete policiesYes (any user's)Yes (own only)
Attach/detach databasesYes (any database)Yes (own databases only)
View all policiesYes (across all users)Own policies only
Delete individual backupsYesYes (own only)
Reset failure counterYesYes (own only)
Trigger manual backupYesYes (own only)
Restore from backupYesYes (own only)
PITR restoreYesYes (own only)

Troubleshooting

Policy stuck in "Error" status

The policy auto-pauses after 3 consecutive backup failures.

  1. Check the error message on the policy detail page
  2. Click Test Connection to verify S3 credentials are still valid
  3. Verify the database is running and reachable
  4. Click Reset Failures to resume the policy

Backup fails with "S3 upload failed"

  1. Verify S3 credentials are still valid (keys may have been rotated)
  2. Check that the S3 bucket exists and has the correct permissions
  3. For non-AWS endpoints (MinIO), verify the endpoint URL is correct and HTTPS is configured

PITR status shows "Error"

PITR errors indicate broken archive continuity. Use Retry PITR Configuration on the database detail page to re-deploy the PITR configuration.

Incremental backup falls back to full

This happens when the parent full backup was deleted by retention cleanup or had incomplete metadata. The system automatically runs a full backup instead to maintain backup chain integrity.

Restore fails

  1. Check the task status on the admin dashboard for error details
  2. Ensure sufficient disk space on the database for temporary restore files
  3. For PITR restores, recovery may take time if many transaction log segments need replaying

Cannot attach database: "Database is already attached to another backup policy"

A database can be attached to only one policy at a time. Detach the database from its current policy first, then attach it to the new one.