You must upgrade your engine version if your Database Instance uses an End of Life engine version that is no longer maintained.
How to upgrade your Database Instance engine version
If your database engine is outdated, you can upgrade the version to the latest one anytime via the Scaleway console.
The version upgrade is only available for:
- Database Instances using engine versions preceding the most recent version available.
- Database Instances using Block volumes. If your Database Instance uses a Local volume, you must first change the volume type to a Block volume and try again.
Before you startLink to this anchor
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A PostgreSQL Database Instance running on an outdated engine version
How to remove incompatible data typesLink to this anchor
Before upgrading to a newer major PostgreSQL version, you must remove any data types incompatible with the pg_upgrade
tool.
The reg*
data type, for example, cannot be persisted by pg_upgrade
.
Run the following command in your Database Instance to identify all instances of the reg*
data type:
SELECT count(*) FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n, pg_catalog.pg_attribute aWHERE c.oid = a.attrelidAND NOT a.attisdroppedAND a.atttypid IN ('pg_catalog.regproc'::pg_catalog.regtype,'pg_catalog.regprocedure'::pg_catalog.regtype,'pg_catalog.regoper'::pg_catalog.regtype,'pg_catalog.regoperator'::pg_catalog.regtype,'pg_catalog.regconfig'::pg_catalog.regtype,'pg_catalog.regdictionary'::pg_catalog.regtype)AND c.relnamespace = n.oidAND n.nspname NOT IN ('pg_catalog', 'information_schema');
We recommend you remove the identified instances before continuing.
How to upgrade the engine versionLink to this anchor
-
Click PostgreSQL and MySQL under Managed Databases on the side menu. A list of your Database Instances displays.
-
Click the name of the database whose engine you want to upgrade. The Database Instance information page appears.
-
Click Upgrade under Database engine. A pop-up appears.
-
Select the upgrade method. Two methods are available:
- Upgrade only: This method has no impact on your original Database Instance. Your Database Instance will remain available with its original endpoint and will continue to be billed.
- Upgrade and switch incoming traffic: With this method, your endpoint is migrated to the new Database Instance automatically. This option will create a clone of your Database Instance, and will automatically migrate the endpoint to the new Instance. The original Database Instance remains available and will continue to be billed. The endpoint will be deleted from the original Database Instance.
ImportantWhen you upgrade to a new version:
- There is no synchronization between the source and target Database Instances. To avoid data loss, we recommend you stop any write operations running on your applications during the upgrade. If you let them run during the process, the data will be stored only in the source Database Instance.
- Your Database Instances in High Availability (HA) mode will migrate to a standalone Instance. To maintain your HA mode, you must manually enable HA after the upgrade is complete. The same applies when upgrading Read Replicas.
- Database Instance advanced settings are synced as long as they are still available on the new database engine version.
TipBefore performing an engine upgrade migration, we recommend testing the process in a “dry-run”. This allows you to estimate the migration time and verify its success without affecting your source instance. To do so:
- Run the migration without checking the “migration endpoint” flag. If the test is successful, you can then proceed with the actual migration. Follow the migrating endpoints via the CLI procedure to migrate your endpoints after the upgrade. You can use the same CLI command to revert the endpoint migration anytime.
- Keep in mind that reverting the endpoint will not affect the data stored on the databases. This means that if some entries were added to the upgraded database, they will not be added back to the old version when you change the endpoints.
-
Click Upgrade version. A new Database Instance is created.
Important- In PostgreSQL major upgrades, the
pgaudit
andpg_stat_statements
engine extensions will be removed. You must reinstall these extensions on each database they are installed once the upgrade is complete. - If you are upgrading to PG16, we recommend you reset your user passwords from the console or using
psql
, PostrgreSQL’s CLI. PG16 uses the SCRAM-SHA-256 format to store passwords. The previous versions’ password format is no longer supported in PG16. You can re-save your passwords after the upgrade and they will be stored in the correct format automatically.
- In PostgreSQL major upgrades, the