Upgrading a database version of Aurora DB cluster
If you have a Aurora DB Cluster in the Cloud Platform, you must keep it up to date and use the most cost effective instance type for your needs.
AWS publishes an end-of-life schedule for major and minor versions of Postgresql and MySQL to help you keep your database up to date and plan for upgrades.
Things to note before upgrading a database version
A minor database version upgrade, a major database version upgrade, or changing your DB cluster instance type will always cause downtime.
There is no rule of thumb to work out how long it will take, but tests show an empty database using a
db.t4g.micro
will take around 10 minutes.
Upgrading to a new major database version
Note: This will cause downtime. See Things to note before upgrading your database.
To upgrade your major Aurora DB Cluster version, complete these eight steps:
- Check if your current and new major database version supports the instance type you’re currently using by reading Supported DB instance classes
If your new major database version does not support your current instance type, update the instance type first before upgrading your major database version.
Raise and merge a PR to tell the apply pipeline to skip your namespace This is applicable for either updating the instance type or the major version of your database.
(Optional) If you have custom RDS instance group parameters, raise and merge a PR to set the default parameter group of the current major version of your database engine. For example, if you current DB engine is postgres14 set the
db_parameter_group_name
todefault.aurora-postgresql14
module "rds_aurora" { source = "github.com/ministryofjustice/cloud-platform-terraform-rds-aurora?ref=<version>" # Database configuration engine = "aurora-postgresql" engine_version = "14.6" db_parameter_group_name = "default.aurora-postgresql14"
Raise and merge a PR that updates the default
db_parameter_group_name
aboveRaise and merge a PR that updates the
allow_major_version_upgrade
,engine_version
attributes to your new major version:module "rds_aurora" { source = "github.com/ministryofjustice/cloud-platform-terraform-rds-aurora?ref=<version>" # Database configuration engine = "aurora-postgresql" engine_version = "15.5" allow_major_version_upgrade = true
If you have a custom parameter group, update the family to the new major version. For example, if your new major engine version is
15
then update the family to “aurora-postgresql15”As soon as this PR is merged, the major version upgrade will begin.
Raise and merge a PR to remove the
APPLY_PIPELINE_SKIP_THIS_NAMESPACE
file added in step 2 If you have a custom parameter group, add back thedb_parameter_group_name
to the custom parameter group name.