How can I decrease the total provisioned storage size of my Amazon RDS DB instance?

Last updated: 2020-06-22

I want to decrease the total allocated storage size of my Amazon Relational Database Service (Amazon RDS) DB instance. How can I do this?

Short description

After you create an Amazon RDS DB instance, you can't modify the allocated storage size of the DB instance to decrease the total storage space it uses. To decrease the storage size of your DB instance, create a new DB instance that has less provisioned storage size. Then, migrate your data into the new DB instance using one of the following methods:

  • Use the database engine's native dump and restore method.
    Note:
    This method causes some downtime.

  • Use AWS Database Migration Service (AWS DMS) for minimal downtime.

Resolution

DB dump and restore

  1. Open the Amazon RDS console, and then choose Databases from the navigation pane.
  2. Choose Create database.
  3. Launch a new Amazon RDS DB instance that has a smaller storage size than your existing DB instance.
  4. Use your database engine's native tools to dump your existing DB instance (the instance you want to decrease in size).
  5. Optionally, you can rename your old DB instance, and then name the new DB instance using the old DB instance's name. Or you can reconfigure applications to use the new DB instance's name.
  6. Restore the database in your new DB instance.

Note: To restore your database, you can use the pg_dump utility for PostgreSQL or for PostgreSQL versions 10.10 and later, and 11.5. Later, you can consider using Transportable Databases which can move data much faster than the pg_dump/pg_restore method. The mysqldump utility is available for importing data into MySQL/MariaDB engines, or you can use the external replication method for reduced downtime. Similarly, you can use Data Pump for Oracle and native full backup (.bak files) for SQL Server.

Note: Downtime occurs from the time that your old DB instance stops receiving connections until the time that Amazon RDS directs the connections from your application to the new DB instance.

Replication with AWS DMS

You can use AWS DMS to set up homogeneous replication between your two DB instances. For more information, see Getting started with AWS Database Migration Service.