Amazon Relational Database Service
User Guide (API Version 2013-09-09)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Upgrading a DB Instance

Amazon RDS supports major version upgrades from MySQL 5.1 to MySQL 5.5, and from Microsoft SQL Server 2008 R2 to SQL Server 2012. You use the Amazon RDS modify operation to perform a major version upgrade of a DB instance.You can also use the modify operation to manually apply a minor version upgrade.

Upgrade Overview

You control when to upgrade your DB instance to a new version supported by Amazon RDS. You can maintain compatibility with specific MySQL versions, test new versions with your application before deploying in production, and perform version upgrades at times that best fit your schedule.

By default, your DB Instance will automatically be upgraded to new minor versions as they are supported by Amazon RDS. This patching will occur during your scheduled maintenance window, and it will be announced on the Amazon RDS Community Forum in advance. To turn off automatic version upgrades, set the AutoMinorVersionUpgrade parameter of a DB instance to "false".

If you opt out of automatically scheduled upgrades, you can manually upgrade a DB instance to a supported minor version release by following the procedure documented in this topic to modify the DB instance, specifying the new minor version number.

Because major version upgrades involve some compatibility risk, they will not occur automatically; you must manually modify the DB instance. You should thoroughly test any upgrade before applying your production instances.

Testing an Upgrade

Before you perform a major version upgrade on your DB instance, you should thoroughly test both your database and the host application for compatibility. We suggest you do the following:

  1. Review the upgrade documentation for the new version of the database engine to see if there are compatibility issues that might affect your database or applications:

  2. If your DB instance is a member of a custom DB parameter group, you need to create a new DB parameter group with your existing settings that is compatible with the new major version. Specify the new DB parameter group when you upgrade your test instance, so that your upgrade testing ensures that it works correctly. For more information about creating a DB parameter group, see Working with DB Parameter Groups

  3. Create a DB snapshot of the DB instance to be upgraded. For more information, see Creating a DB Snapshot.

  4. Restore the DB snapshot to create a new test DB instance. For more information, see Restoring From a DB Snapshot

  5. Modify this new test DB instance to upgrade it to the new version, using one of the methods detailed below. If you created a new parameter group in step 2, specify that parameter group.

  6. Evaluate the storage used by the upgraded instance to determine if the upgrade requires additional storage.

  7. Run as many of your quality assurance tests against the upgraded DB instance as needed to ensure that your database and application work correctly with the new version. Implement any new tests needed to evaluate the impact of any compatibility issues you identified in step 1. Test all stored procedures and functions. Direct test versions of your host applications to the upgraded DB instance.

  8. If all tests pass, then perform the upgrade on your production DB instance. We suggest you do not allow writes to the DB instance until you can confirm that everything is working correctly.

DB Instance Upgrade Considerations

If the DB instance is using read replication, you must upgrade all of the read replicas before upgrading the source instance. If the DB instance is in a multi-AZ deployment, both the primary and standby replicas are upgraded, and the instance may not be available until the upgrade is complete.

Amazon RDS takes two DB snapshots during the upgrade process. The first DB snapshot is of the DB instance before any upgrade changes have been made. If the upgrade doesn't work for your databases, you can restore this snapshot to create a DB instance running the old version. The second DB snapshot is taken when the upgrade completes.

If Amazon RDS encounters any issues when upgrading SQL Server and needs to rollback, Amazon RDS restores your DB instance from the first DB snapshot.

For MySQL upgrades, the first snapshot is a user snapshot that is retained until you delete it. For SQL Server upgrades, the first snapshot is a system snapshot that is retained only until the end of the backup retention period.

MySQL major version upgrades typically complete in about 10 minutes, and SQL Server upgrades typically complete in about 30 minutes. Upgrades may take longer, depending on the class of DB instance, or whether the instance follows the operational guidelines in the Amazon RDS Best Practices. If you are upgrading a DB instance from the Amazon RDS console, the status of the DB instance will indicate when the upgrade is complete. If you are using the CLI, use the rds-describe-db-instance command and check the Status value.

After the upgrade is complete, you cannot revert to the previous version of the database engine. If you want to return to the previous version, restore the first DB snapshot taken to create a new DB instance.

In addition to applying major version upgrades to instances of MySQL and SQL Server, you can manually apply minor version upgrades to instances of MySQL or Oracle. You can also specify that minor version upgrades be applied automatically to instances of MySQL and Oracle. For more information about managing minor version upgrades, see Amazon RDS MySQL Versions or Oracle Version Management

Note

During a major version upgrade of SQL Server, the Free Storage Space and Disk Queue Depth metrics will display -1. After the upgrade is complete, both metrics will return to normal.

Note

During a major version upgrade of MySQL, Amazon RDS runs the MySQL binary mysql_upgrade to upgrade tables, if required. Also, Amazon RDS may empty the slow_log and general_log tables.

AWS Management Console

To upgrade a DB instance

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, click Instances.

  3. Select the check box for the DB instance that you want to upgrade.

  4. Click Instance Actions and click Modify.

  5. In the DB Engine Version box, click the new version.

  6. To upgrade immediately, select the Apply Immediately check box. To delay the upgrade to the next maintenance window, clear the check box.

  7. Click Continue.

  8. Review the modification summary information. To proceed with the upgrade, click Modify DB Instance. To cancel the upgrade instead, click the X in the upper right corner.

CLI

To upgrade a DB instance

  • Use the CLI command rds-modify-db-instance specifying the DB instance identifier and using the following parameters:

    • --engine-version = the new DB engine version

    • --allow-major-version-upgrade = true

    • --apply-immediately = true to upgrade immediately, or false to delay the upgrade until the next maintenance window

    Example

    PROMPT>rds-modify-db-instance SQLServer1 --engine-version 11.00.2100.60.v1 --allow-major-version-upgrade true --apply-immediately true


API

To upgrade a DB instance

  • Call ModifyDBInstance with the following parameters:

    • DBInstanceIdentifier = the identifier of the instance to be upgraded

    • EngineVersion = the new DB engine version

    • AllowMajorVersionUpgrade = true

    • ApplyImmediately = true to upgrade immediately, or false to delay the upgrade until the next maintenance window

    Example

    https://rds.amazonaws.com/
    	?Action=ModifyDBInstance
    	&DBInstanceIdentifier=MySQL-Instance1
    	&EngineVersion=5.5.31
    	&AllowMajorVersionUpgrade=true
    	&ApplyImmediately=true