The most counterintuitive aspect of an RDS major version upgrade is that the absence of activity during the upgrade process is the most critical indicator of success.

Let’s walk through a real-world scenario. Imagine you have a PostgreSQL 13 RDS instance, and you need to upgrade it to PostgreSQL 14. This isn’t just a simple patch; it’s a significant architectural shift for the database.

Here’s how you’d plan and execute it safely, making sure you don’t end up with a bricked instance or corrupted data.

Pre-Upgrade Planning: The Due Diligence

  1. Understand the Scope: Major version upgrades in RDS are not in-place. RDS creates a new instance with the target version and then migrates your data. Your old instance remains untouched until you explicitly delete it. This is your safety net.

  2. Check Compatibility: This is paramount. PostgreSQL major versions often introduce breaking changes, deprecations, or new features that might affect your application.

    • Action: Review the official PostgreSQL release notes for the target version (e.g., PostgreSQL 14 Release Notes). Pay close attention to sections on "Backward Incompatible Changes" and "Deprecations."
    • Example: PostgreSQL 14 deprecated several functions and introduced changes to pg_attribute.attoptions. Your application’s SQL queries or ORM might need adjustments.
  3. Test Thoroughly: Never upgrade production directly.

    • Action: Create a snapshot of your production RDS instance. Restore this snapshot into a new RDS instance with the target major version. This new instance is your staging environment.
    • Command: aws rds restore-db-instance-from-db-snapshot --db-snapshot-identifier your-prod-snapshot-id --db-instance-identifier your-staging-instance-id --engine pg --engine-version 14.x --db-subnet-group-name your-staging-subnet-group --vpc-security-group-ids sg-xxxxxxxxxxxxxxxxx
    • Verification: Run your application’s test suite against this staging instance. Monitor logs for errors. Perform manual functional testing for critical workflows. Check query performance; some queries might behave differently.
  4. Parameter Group and Option Group: These control your database’s configuration and features.

    • Action: Create new custom parameter groups and option groups for the target PostgreSQL version. Copy settings from your production groups, but review them for version-specific changes.
    • AWS Console: Navigate to RDS -> Parameter Groups -> Create parameter group. Select the correct engine and version.
    • Why it matters: Default parameter groups might have settings optimized for older versions or might not be compatible with new features in the target version.
  5. Backup Strategy: Ensure your backups are working and you know how to restore.

    • Action: Take a manual snapshot of your production instance immediately before starting the upgrade process. This is your absolute last resort rollback point.
    • Command: aws rds create-db-snapshot --db-instance-identifier your-prod-instance-id --db-snapshot-identifier your-prod-snapshot-pre-upgrade-$(date +%Y-%m-%d-%H-%M-%S)

Execution: The Controlled Rollout

  1. Choose Your Method: You have two primary options:

    • Option A: Blue/Green Deployment (Recommended for minimal downtime): Create a new RDS instance with the target version, migrate data, switch your application’s connection strings, and then decommission the old instance. This is often done outside of RDS’s automated upgrade feature by manually creating a new instance and migrating.
    • Option B: RDS In-Place Upgrade (Simpler, but with downtime): Use RDS’s built-in upgrade mechanism. This will cause downtime as RDS performs the upgrade.
  2. Performing the RDS In-Place Upgrade (Option B):

    • Action: Navigate to your RDS instance in the AWS console. Select "Modify." Under "Engine version," choose your target major version (e.g., PostgreSQL 14.x). Select your new custom parameter group and option group. Choose whether to apply immediately or during the next maintenance window.
    • Downtime: RDS will stop the instance, perform the upgrade, and then restart it. The duration depends on instance size, data volume, and complexity of the upgrade. You can monitor the status in the console.
    • Command (CLI equivalent): aws rds modify-db-instance --db-instance-identifier your-prod-instance-id --engine-version 14.x --db-parameter-group-name your-pg14-parameter-group --option-group-name your-pg14-option-group --allow-major-version-upgrade
  3. Post-Upgrade Verification:

    • Action: Once the instance is available, immediately connect and run basic checks.
    • Command: SELECT version(); (to confirm the new version)
    • Check Logs: Review the RDS logs (PostgreSQL logs) for any errors or warnings that occurred during or after the upgrade.
    • Application Connectivity: Ensure your application can connect successfully.
    • Performance Monitoring: Use CloudWatch metrics (CPU utilization, read/write IOPS, latency) to spot any immediate performance regressions.

The "Absence of Activity" Indicator

The most surprising true thing about a successful RDS major version upgrade is that the lack of new errors appearing in your application logs or RDS logs after the instance becomes available is the strongest signal that everything is okay. It’s not about seeing new, expected activity; it’s about the absence of unexpected, critical failures. The system has silently transitioned, and your application can interact with it as if nothing fundamentally changed, aside from the version number. This silence is golden.

The One Thing Most People Don’t Know

Many assume that the allow-major-version-upgrade flag in the modify-db-instance command handles all the complexities. However, if you are using custom extensions or have specific PostgreSQL configurations tied to the operating system level of the underlying RDS instance (which is generally abstracted away, but not entirely for certain advanced configurations), these might not carry over seamlessly. RDS tries its best to manage this, but edge cases exist where a manual re-installation or re-configuration of certain extensions might be necessary on the new instance after the upgrade completes, especially if you’ve been heavily customizing the PostgreSQL environment beyond typical parameter settings.

After a successful major version upgrade, the next immediate challenge you’ll likely face is optimizing query performance, as new PostgreSQL versions often have different query planners.

Want structured learning?

Take the full Rds course →