Charmed PostgreSQL VM
- By Canonical Data Platform
- Databases
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 345 | 09 Nov 2023 | |
latest/stable | 239 | 09 Feb 2022 | |
latest/stable | 226 | 01 Apr 2021 | |
14/stable | 430 | 28 Jun 2024 | |
14/stable | 429 | 28 Jun 2024 | |
14/candidate | 468 | 02 Sep 2024 | |
14/candidate | 467 | 02 Sep 2024 | |
14/beta | 468 | 02 Sep 2024 | |
14/beta | 467 | 02 Sep 2024 | |
14/edge | 472 | Yesterday | |
14/edge | 471 | Yesterday |
juju deploy postgresql --channel 14/stable
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
Note: All commands are written for juju >= v.3.0
If you are using an earlier version, check the Juju 3.0 Release Notes.
How to migrate a cluster
This is a guide on how to restore a backup that was made from a different cluster, (i.e. cluster migration via restore).
To perform a basic restore (from a local backup), see Charmed PostgreSQL VM | How to restore a local backup.
Prerequisites
Restoring a backup from a previous cluster to a current cluster requires:
- A single unit Charmed PostgreSQL deployed and running
- Access to S3 storage
- Configured settings for S3 storage
- Backups from the previous cluster in your S3 storage
- Passwords from your previous cluster
Manage cluster passwords
When you restore a backup from an old cluster, it will restore the password from the previous cluster to your current cluster. Set the password of your current cluster to the previous cluster’s password:juju run postgresql/leader set-password username=operator password=<previous cluster password>
juju run postgresql/leader set-password username=replication password=<previous cluster password>
juju run postgresql/leader set-password username=rewind password=<previous cluster password>
List backups
To view the available backups to restore, use the command list-backups
:
juju run postgresql/leader list-backups
This shows a list of the available backups (it is up to you to identify which backup-id
corresponds to the previous-cluster):
backups: |-
backup-id | backup-type | backup-status
----------------------------------------------------
YYYY-MM-DDTHH:MM:SSZ | physical | finished
Restore backup
To restore your current cluster to the state of the previous cluster, run the restore
command and pass the correct backup-id
to the command:
juju run postgresql/leader restore backup-id=YYYY-MM-DDTHH:MM:SSZ
Your restore will then be in progress. Once it is complete, your current cluster will represent the state of the previous cluster.