Skip to content

Backup and clone

Last updated on

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

  • Automatic backup of your instances
  • Point-in-time restore for all backups (WAL (Write-Ahead Log) is activated by default)
  • 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 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.

There is no fee for the backup service itself; charges apply only to the storage volume occupied by the backup files. 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.

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

Terminal window
stackit postgresflex 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 * * *. 45 16 * * * means every day at 16:45 UTC. Currently we allow only daily backups. So you can choose when the backup window starts

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

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

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

You can use one of the following ways to get an overview of the existing backups.

Terminal window
stackit postgresflex backup list --instance-id <instance-id>

The output should be like the following:

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.

Clone feature gives you the opportunity to restore a specific backup to a new instance in the same STACKIT project. You can choose any point-in-time of your available backups. Currently, STACKIT offers no in-place-restore. So if needed, you will have to redirect your clients to point to the cloned instance.

Terminal window
stackit postgresflex instance clone <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