Upgrading a DB instance engine version (original) (raw)

Amazon RDS provides newer versions of each supported database engine so you can keep your DBinstance up-to-date. Newer versions can include bug fixes, security enhancements, and other improvements for the database engine. WhenAmazon RDS supports a new version of a database engine, you can choose how and when to upgrade your database DBinstances.

There are two kinds of upgrades: major version upgrades and minor version upgrades. In general, a major engine version upgrade can introduce changes that are not compatible with existing applications. In contrast, a_minor version upgrade_ includes only changes that are backward-compatible with existing applications.

For Multi-AZ DB clusters, major version upgrades are only supported for RDS for PostgreSQL. Minor version upgrades are supported for all engines that support Multi-AZ DB clusters. For more information, see Upgrading the engine version of a Multi-AZ DB cluster for Amazon RDS.

The version numbering sequence is specific to each database engine. For example, RDS for MySQL 5.7 and 8.0 are major engine versions and upgrading from any 5.7 version to any 8.0 version is a major version upgrade. RDS for MySQL version 5.7.22 and 5.7.23 are minor versions and upgrading from 5.7.22 to 5.7.23 is a minor version upgrade.

Important

You can't modify a DB instance when it is being upgraded. During an upgrade, the DB instance status is upgrading.

For more information about major and minor version upgrades for a specific DB engine, see the following documentation for your DB engine:

For major version upgrades, you must manually modify the DB engine version through the AWS Management Console, AWS CLI, or RDS API. For minor version upgrades, you can manually modify the engine version, or you can choose to enable the Auto minor version upgrade option.

Topics

Manually upgrading the engine version

To manually upgrade the engine version of a DB instance, you can use the AWS Management Console, the AWS CLI, or the RDS API.

To upgrade the engine version of a DB instance by using the console
  1. Sign in to the AWS Management Console and open the Amazon RDS console athttps://console.aws.amazon.com/rds/.
  2. In the navigation pane, choose Databases, and then choose the DB instance that you want to upgrade.
  3. Choose Modify. The Modify DB instance page appears.
  4. For DB engine version, choose the new version.
  5. Choose Continue and check the summary of modifications.
  6. Decide when to schedule your upgrade:
    • To put the changes into the pending modifications queue, choose Apply during the next scheduled maintenance window. During the next maintenance window, RDS applies any pending changes in the queue.
    • To apply the changes immediately, choose Apply immediately. Choosing this option can cause an outage in some cases. For more information, see Using the schedule modifications setting.
  7. On the confirmation page, review your changes. If they are correct, choose Modify DB instance to save your changes.
    Alternatively, choose Back to edit your changes, or choose Cancel to cancel your changes.

To upgrade the engine version of a DB instance, use the CLI modify-db-instance command. Specify the following parameters:

Example

For Linux, macOS, or Unix:

aws rds modify-db-instance \
    --db-instance-identifier mydbinstance \
    --engine-version new_version \
    --allow-major-version-upgrade \
    --no-apply-immediately

For Windows:

aws rds modify-db-instance ^
    --db-instance-identifier mydbinstance ^
    --engine-version new_version ^
    --allow-major-version-upgrade ^
    --no-apply-immediately

To upgrade the engine version of a DB instance, use the ModifyDBInstance action. Specify the following parameters:

Automatically upgrading the minor engine version

Automatic minor version upgrades periodically update your database to recent database engine versions. However, the upgrade might not always include the latest database engine version. If you need to keep your databases on specific versions at particular times, we recommend that you manually upgrade to the database versions that you need according to your required schedule. In cases of critical security issues or when a version reaches its end-of-support date, Amazon RDS might apply a minor version upgrade even if you haven't enabled the Auto minor version upgrade option. For more information, see the upgrade documentation for your specific database engine.

Topics

How automatic minor version upgrades work

The upgrade target is the DB engine version to which Amazon RDS upgrades your database. A minor engine version is designated as the upgrade target when the following conditions are met:

RDS schedules the upgrade to run automatically in the maintenance window. During the upgrade, RDS does the following:

  1. Runs a system precheck to make sure the database is healthy and ready to be upgraded
  2. Upgrades the DB engine to the target minor engine version
  3. Runs post-upgrade checks
  4. Marks the database upgrade as complete

Automatic upgrades incur downtime. The length of the downtime depends on various factors, including the DB engine type and the size of the database.

Turning on automatic minor version upgrades

You can control whether auto minor version upgrade is enabled for a DB instance when you perform the following tasks:

When you perform these tasks, you can control whether auto minor version upgrade is enabled for the DB instance in the following ways:

Determining the availability of maintenance updates

To determine whether a maintenance update, such as a DB engine version upgrade, is available for your DB instance, you can use the console, AWS CLI, or RDS API. You can also upgrade the DB engine version manually and adjust the maintenance window. For more information, see Maintaining a DB instance.

Finding automatic minor version upgrade targets

You can use the following AWS CLI command to determine the current automatic minor upgrade target version for a specified minor DB engine version in a specific AWS Region. You can find the possible --engine values for this command in the description for the Engine parameter in CreateDBInstance.

For Linux, macOS, or Unix:

aws rds describe-db-engine-versions \
--engine engine \
--engine-version minor-version \
--region region \
--query "DBEngineVersions[*].ValidUpgradeTarget[*].{AutoUpgrade:AutoUpgrade,EngineVersion:EngineVersion}" \
--output text

For Windows:

aws rds describe-db-engine-versions ^
--engine engine ^
--engine-version minor-version ^
--region region ^
--query "DBEngineVersions[*].ValidUpgradeTarget[*].{AutoUpgrade:AutoUpgrade,EngineVersion:EngineVersion}" ^
--output text

For example, the following AWS CLI command determines the automatic minor upgrade target for MySQL minor version 8.0.11 in the US East (Ohio) AWS Region (us-east-2).

For Linux, macOS, or Unix:

aws rds describe-db-engine-versions \
--engine mysql \
--engine-version 8.0.11 \
--region us-east-2 \
--query "DBEngineVersions[*].ValidUpgradeTarget[*].{AutoUpgrade:AutoUpgrade,EngineVersion:EngineVersion}" \
--output table

For Windows:

aws rds describe-db-engine-versions ^
--engine mysql ^
--engine-version 8.0.11 ^
--region us-east-2 ^
--query "DBEngineVersions[*].ValidUpgradeTarget[*].{AutoUpgrade:AutoUpgrade,EngineVersion:EngineVersion}" ^
--output table

Your output is similar to the following.

----------------------------------
|    DescribeDBEngineVersions    |
+--------------+-----------------+
|  AutoUpgrade |  EngineVersion  |
+--------------+-----------------+
|  False       |  8.0.15         |
|  False       |  8.0.16         |
|  False       |  8.0.17         |
|  False       |  8.0.19         |
|  False       |  8.0.20         |
|  False       |  8.0.21         |
|  True        |  8.0.23         |
|  False       |  8.0.25         |
+--------------+-----------------+

In this example, the AutoUpgrade value is True for MySQL version 8.0.23. So, the automatic minor upgrade target is MySQL version 8.0.23, which is highlighted in the output.

Important

If you plan to migrate an RDS for PostgreSQL DB instance to an Aurora PostgreSQL DB cluster soon, we strongly recommend that you turn off auto minor version upgrades for the DB instance early during planning. Migration to Aurora PostgreSQL might be delayed if the RDS for PostgreSQL version isn't yet supported by Aurora PostgreSQL. For information about Aurora PostgreSQL versions, see Engine versions for Amazon Aurora PostgreSQL.