Amazon Relational Database Service
User Guide (API Version 2014-09-01)
« 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 the following major version upgrades:

  • MySQL 5.1 to MySQL 5.5

  • MySQL 5.5 to MySQL 5.6

  • Microsoft SQL Server 2008 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 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
    							

Upgrading from MySQL 5.1 to MySQL 5.6

To upgrade a MySQL version 5.1 DB instance on Amazon RDS to MySQL version 5.6, you must first upgrade your DB instance to MySQL version 5.5, as described in previous sections. Once you have upgraded to MySQL version 5.5, follow the instructions in this topic to upgrade your DB instance to version 5.6.

Upgrading from MySQL 5.5 to MySQL 5.6

To upgrade your MySQL DB version 5.5 instance on Amazon RDS to MySQL version 5.6, follow the instructions in the previous sections. However, MySQL 5.5 DB instances created before April 23, 2014 cannot be automatically upgraded using the console. If you attempt to upgrade a MySQL 5.5 DB instance created before April 23, 2014 using the Amazon RDS CLI or API, you will receive the following error:

            The requested modify operation is currently unavailable for this DB instance as it is running an older version of the 
            system software. You can however perform this modification by following a few steps. You can create a new Read Replica, 
            perform the modify operation on it, wait for the Read Replica to catch up and then promote it. Refer to the Working with 
            Read Replicas section of the Amazon RDS User Guide to learn more. Alternatively, you can take a snapshot and restore it 
            to a new DB instance and become eligible to perform this operation.
        

You can still upgrade your MySQL 5.5 DB instance created before April 23, 2014 to a MySQL 5.6 using the following procedure.

Note

You can use this upgrade procedure to modify a MySQL DB instance created before April 23, 2014 to use a memory optimized db.r3 DB Instance class. When following the procedure, use the MySQL version numbers that apply to you. For more information on the db.r3 instance classes, see DB Instance Class.

  1. Using the Amazon RDS console, create a read replica of your MySQL 5.5 DB instance. This will create an upgradable copy of your database.

    1. In the console, click Instances and select the DB instance that you want to upgrade.

    2. Click Instance Actions and select Create Read Replica.

    3. Provide a DB Instance Identifier for your read replica and ensure that the DB instance Class and other settings match your MySQL 5.5 DB instance.

    4. Click Yes, Create Read Replica.

  2. When the read replica has been created and the Status shows as available, upgrade the read replica to MySQL 5.6.

    1. In the console, click Instances and select the read replica that you just created.

    2. Click Instance Actions and click Modify.

    3. In the DB Engine Version box, select the MySQL 5.6 version to upgrade to and select the Apply Immediately check box. Click Continue.

    4. Click Modify DB Instance to start the upgrade.

  3. When the upgrade is complete and the Status shows as available, verify that the upgraded read replica is up to date with the master MySQL 5.5 DB instance. You can do this by connecting to the read replica and issuing the SHOW SLAVE STATUS command. If the Seconds_Behind_Master field is "0", then replication is up to date.

  4. Make your MySQL 5.6 read replica a master DB instance.

    Important

    When you promote your MySQL 5.6 read replica to a standalone, Single-AZ DB instance, it will no longer be a replication slave to your MySQL 5.5 DB instance. It is recommended that you promote your MySQL 5.6 read replica during a maintenance window when your source MySQL 5.5 DB instance is in read-only mode and all write transactions are suspended. When the promotion is completed, you can direct your write transactions to the upgraded MySQL 5.6 DB instance to ensure that no write transactions are lost.

    Important

    Prior to promoting your MySQL 5.6 read replica, it is recommended that you perform all necessary DDL operations, such as creating indexes, on the MySQL 5.6 read replica. This will avoid any effects on the performance of the MySQL 5.6 read replica after it has been promoted.

    1. In the console, click Instances and select the read replica that you just upgraded.

    2. Click Instance Actions and select Promote Read Replica.

    3. Enable automated backups for the read replica instance. For more information, see Working With Automated Backups.

      Click Continue.

    4. Click Yes, Promote Read Replica.

  5. You now have an upgraded version of your MySQL database. At this point, you can direct your applications to the new MySQL 5.6 DB instance, add read replicas, set up Multi-AZ support, and so on.

Note

You can also upgrade your MySQL 5.5 DB instance on Amazon RDS to MySQL 5.6 by creating a snapshot of your MySQL 5.5 DB instance, restore that snapshot to a new MySQL 5.5 DB instance, and then upgrade that new DB instance to MySQL version 5.6. However, updates made to your original MySQL 5.5 DB instance during the time it takes to create the snapshot and restore it to a new DB instance will not be present in your upgraded DB instance. As a result, it is recommended that you use read replicas as described in this section to upgrade your DB instance.