Skip to content

Backup and clone

Backup and restore is an essential feature to guarantee the SLAs of your service. STACKIT’s PostgreSQL Flex offers backup and restore capabilities to help you achieve this goal. These are the features of the backup and restore capabilities:

  • Backup and clone of your instances
  • Point-in-time restore for all backups (WAL (Write-Ahead Log) is activated by default)
  • Snapshot retention to up for one month
  • Cloning to another instance in the same project
  • All settings are accessible via the Portal, the CLI, Cloud Foundry and Terraform.

You can configure the backup settings to the needs of your business. STACKIT’s PostgreSQL Flex offers backups on a daily basis. These backups also include transaction logs. The latter gives you the chance to restore to an arbitrary point in time.

You don’t pay for the backup itself, but for the storage the generated backup files reserve. The storage size depends on your backup settings and on the accumulated instance databases size. At the moment, you need to estimate the storage need by yourself.

SettingDescriptionOptions
Backup ScheduleDefines how often on every day a backup is createdTime of day (UTC )

You can get an overview of the current backup settings of an instance.

FlagDescription
instance-idInstance ID of the instance you want to query
Terminal window
stackit postgresqlflex instance describe <instance-id>

You get an output like this:

ID │ a9b3b1dd-308e-4a00-b269-11d136e65824
──────────────────────┼──────────────────────────────────────────────────
NAME │ postgres-qaeq2npfyl75
──────────────────────┼──────────────────────────────────────────────────
STATUS │ Ready
──────────────────────┼──────────────────────────────────────────────────
STORAGE SIZE (GB) │ 5
──────────────────────┼──────────────────────────────────────────────────
VERSION │ 17
──────────────────────┼──────────────────────────────────────────────────
ACL │ 193.148.160.0/19,45.129.40.0/21,84.136.82.147/32
──────────────────────┼──────────────────────────────────────────────────
FLAVOR DESCRIPTION │ Small, Compute optimized
──────────────────────┼──────────────────────────────────────────────────
TYPE │ Single
──────────────────────┼──────────────────────────────────────────────────
REPLICAS │ 1
──────────────────────┼──────────────────────────────────────────────────
CPU │ 2
──────────────────────┼──────────────────────────────────────────────────
RAM (GB) │ 4
──────────────────────┼──────────────────────────────────────────────────
BACKUP SCHEDULE (UTC) │ 45 16 * * *

The backup schedule (UTC) value holds the information. Its format is minute hour day month year. 45 16 * * * means every day at 16:45 UTC.

BACKUP SCHEDULE (UTC) is the representation for the Backup Schedule setting. It follows the cron format. The important number is behind the slash and reflects whether a backup is run either every 6, 8, 12 or 24 hours. DAILY SNAPSHOT RETENTION (DAYS), WEEKLY SNAPSHOT RETENTION (WEEKS) and MONTHLY SNAPSHOT RETENTION (MONTHS) corresond to Daily Snapshot Retention, Weekly Snapshot Retention and Monthly Snapshot Retention. SNAPSHOT RETENTION (DAYS) represents Snapshot Retention (simple snapshots). The POINT IN TIME WINDOW (HOURS) shows the amount of time for which you can restore to a specific point in time. From a technical standpoint, it represents the length of the transaction log.

You can modify your backup schedule to adapt the backup to your needs.

FlagDescription
instance-idInstance ID of the instance you want to query
scheduleSee Backup settings and their description

The format for the schedule is 'minute hour * * *'. The values are interpreted as UTC. For example, for creating a backup every day at 9pm UTC, compose '0 21 * * *' as your schedule.

Terminal window
stackit postgresqlflex backup update-schedule --instance-id <instance-id> --schedule <schedule>

You can have an overview of the existing backups.

FlagDescription
instance-idInstance ID of the instance you want to query
Terminal window
stackit postgresqlflex backup list --instance-id <instance-id>

You get something like this:

ID │ CREATED AT │ EXPIRES AT │ BACKUP SIZE
─────────────────────────┼───────────────────────────┼────────────┼─────────────
000000010000000000000002 │ 2025-08-28T14:56:37+00:00 │ 2025-09-27 │ 5.66MB
000000010000000000000007 │ 2025-08-28T16:45:01+00:00 │ 2025-09-27 │ 7.17MB
000000020000000000000015 │ 2025-08-28T22:27:24+00:00 │ 2025-09-27 │ 7.24MB
000000030000000000000018 │ 2025-08-28T22:30:38+00:00 │ 2025-09-27 │ 7.17MB
00000003000000000000003E │ 2025-08-29T16:45:01+00:00 │ 2025-09-28 │ 7.22MB
00000003000000000000006F │ 2025-08-30T16:45:01+00:00 │ 2025-09-29 │ 7.22MB
0000000300000000000000A0 │ 2025-08-31T16:45:01+00:00 │ 2025-09-30 │ 7.22MB
0000000300000000000000D1 │ 2025-09-01T16:45:02+00:00 │ 2025-10-01 │ 7.22MB
000000030000000100000002 │ 2025-09-02T16:45:02+00:00 │ 2025-10-02 │ 7.22MB
000000030000000100000033 │ 2025-09-03T16:45:01+00:00 │ 2025-10-03 │ 7.22MB
000000030000000100000064 │ 2025-09-04T16:45:01+00:00 │ 2025-10-04 │ 7.22MB
000000030000000100000095 │ 2025-09-05T16:45:01+00:00 │ 2025-10-05 │ 7.22MB

The timestamps are in UTC.

You can clone a specific backup to a new instance in the same STACKIT project. You can choose any point-in-time of your available backups. Unfortunately, STACKIT offers no in-place-restore. So you either need to clone to a new instance and manually transfer your databases and tables to your existing instance, or you need your clients to point to the cloned instance.

FlagDescriptionOptional
instance-idInstance ID of the instance you want to query
recovery-timestampTimestamp as of RFC3339 for point-in-time recovery
storage-classDesired storage class for the cloned instance. See Flavors and performance classes of PostgreSQL Flex for available performance classes.x
storage-sizeThe storage size for the cloned instance in GBx
Terminal window
stackit postgresqlflex instance --instance-id <instance-id> --recovery-timestamp <timestamp> --storage-class <storage-class> --storage-size 10
Terminal window
stackit postgresflex instance clone xxx --recovery-timestamp 2023-04-17T09:28:00+00:00
Terminal window
stackit postgresflex instance clone xxx --recovery-timestamp 2023-04-17T09:28:00+00:00 --storage-class premium-perf6-stackit