Automatic backups
DX Cloud provides automatic backups as defined in the values.yml file in your project. The backup sidecar is a container defined in the Magnolia Database (DB) pod of both the author and public workloads. The sidecar provides endpoints to list and create backups. In order to execute the endpoint, a port forward to the corresponding pod/container is required. The backup server is running on port 9999.
values.yml file
The values.yml file is found in the root of your DX Cloud project folder.
...
db:
backup:
enabled: true
env:
- name: MGNLBACKUP_PG_DATA
value: "/db/data"
- name: MGNLBACKUP_USE_PG_WAL <1>
value: "true"
- name: MGNLBACKUP_SYNC_DIR
value: "/archive"
- name: MGNLBACKUP_NO_STDOUT
value: "true"
- name: MGNLBACKUP_LOGLEVEL
value: "debug"
- name: MGNLBACKUP_BUCKET <2>
value: "[subscription-name]-backup-bucket"
- name: MGNLBACKUP_PREFIX
value: {{ .Env.DEPLOYMENT }}/author <3>
- name: MGNLBACKUP_HERITAGE
value: "magnolia-backup"
- name: MGNLBACKUP_CRON <4>
value: "0 3 * * *"
- name: MGNLBACKUP_KEEPDAYS <5>
value: "30"
- name: MGNLBACKUP_S3_ENDPOINT <6>
value: "s3.eu-central-1.amazonaws.com"
- name: MGNLBACKUP_S3_REGION <7>
value: "eu-central-1"
- name: MGNLBACKUP_S3_ACCESSKEY <8>
valueFrom:
secretKeyRef:
name: s3-backup-key
key: accesskey
- name: MGNLBACKUP_S3_SECRETKEY <8>
valueFrom:
secretKeyRef:
name: s3-backup-key
key: secretkey
- name: MGNLBACKUP_TAGS_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MGNLBACKUP_TAGS_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MGNLBACKUP_TAGS_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MGNLBACKUP_TAGS_RELEASE
value: {{ .Env.DEPLOYMENT }}
...
MGNLBACKUP_USE_PG_WAL (write-ahead-logging) has to be enabled in order to use Postgres WAL for Point-in-Time Recovery.
MGNLBACKUP_BUCKET name of the bucket containing the subscription name.
MGNLBACKUP_PREFIX defines the storage path prefix in the S3 bucket for this instance’s backups. This value must be unique for each database instance writing to the same bucket.
MGNLBACKUP_CRON cron expression for how often a full base backup is created.
Note — Recommended Base Backup Rotation Cycles
- Every day at 3am: **0 3 * * *** (or any other time outside of the high traffic hours)
MGNLBACKUP_KEEPDAYS number of days backups are stored in S3 (or similar S3-compatible storage) for the specified number of days.
MGNLBACKUP_S3_ENDPOINT endpoint for S3 server storing the backups.
MGNLBACKUP_S3_REGION AWS region for the S3.
MGNLBACKUP_S3_ACCESSKEY and MGNLBACKUP_S3_SECRETKEY API token credentials for connecting to S3.