postgresql

Charmed PostgreSQL

Channel Revision Published Runs on
latest/stable 591 10 Apr 2025
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
latest/stable 239 09 Feb 2022
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
latest/stable 226 01 Apr 2021
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
14/stable 553 04 Feb 2025
Ubuntu 22.04
14/stable 552 04 Feb 2025
Ubuntu 22.04
14/candidate 593 16 Apr 2025
Ubuntu 22.04
14/candidate 592 16 Apr 2025
Ubuntu 22.04
14/beta 605 Yesterday
Ubuntu 22.04
14/beta 606 Yesterday
Ubuntu 22.04
14/edge 606 23 Apr 2025
Ubuntu 22.04
14/edge 605 23 Apr 2025
Ubuntu 22.04
16/candidate 610 25 Apr 2025
Ubuntu 24.04
16/candidate 609 25 Apr 2025
Ubuntu 24.04
16/beta 610 24 Apr 2025
Ubuntu 24.04
16/beta 609 24 Apr 2025
Ubuntu 24.04
16/edge 610 24 Apr 2025
Ubuntu 24.04
16/edge 609 24 Apr 2025
Ubuntu 24.04
juju deploy postgresql --channel 14/stable
Show information

Platform:

Ubuntu
24.04 22.04 20.04 18.04 16.04 14.04

Migrate database data using ‘backup/restore’

This is a guide for migrating data from modern charms. To migrate legacy charms data, refer to the guide Migrate data via pg_dump.

This Charmed PostgreSQL operator is able to restore its ownbackups stored on S3-compatible storage. The same restore approach is applicable to restore foreign backups made by different Charmed PostgreSQL installation or even another PostgreSQL charm. The backup have to be created manually using pgBackRest!

Warning: The Canonical Data Team describes here the general approach and does NOT support nor guarantee the restoration results.

Always test a migration in a test environment before performing it in production!

Prerequisites

  • Check your application compatibility with Charmed PostgreSQL VM before migrating production data from legacy charm
  • Make sure PostgreSQL versions are identical before the migration

Migrate database data

Below is the general approach to the migration (see warning above!):

  1. Retrieve root/admin level credentials from legacy charm.

    See examples here.

  2. Install pgBackRest inside the old charm OR nearby.

    Ensure the version is compatible with pgBackRest in the new Charmed PostgreSQL revision you are going to deploy! See examples here.

    Note: You can use charmed-postgresql SNAP/ROCK directly. More details here.

  3. Configure storage for database backup (local or remote, S3-based is recommended).

  4. Create a first full logical backup during the off-peak

    See an example of backup command here.

  5. Restore the foreign backup to the Charmed PostgreSQL installation in your test environment.

  6. Perform all the necessary tests to make sure your application accepted the new database.

  7. Schedule and perform the final production migration, re-using the last steps above.


Do you have questions? Contact us if you are interested in such a data migration!


Help improve this document in the forum (guidelines). Last updated 1 year, 2 months ago.