Hey there! 👋
In today’s post, I want to walk you through a step-by-step tutorial on how to apply a major version upgrade to an existing production database in AWS RDS — with zero downtime, no issues, and no fear. 😄
This is based on this real-time video tutorial I recorded, where I performed the upgrade live.
The Safer Upgrade Approach
Let’s say you need to upgrade your production PostgreSQL database (in my case, from version 15.x to 16.9). Here’s the approach I recommend:
- Go to your latest RDS snapshot.
- Restore it to create a temporary test database.
- Upgrade the test database first and see what happens.
- If everything looks good, apply the upgrade to production.
Why take this route? Simple:
Upgrading directly in production is risky. If something goes wrong — missing custom functions, upgrade errors, incompatible extensions — your app may go down, and restoring a backup takes time.
Even if you’re using Multi-AZ, like I do for ghostboard.io, it won’t save you from performance hits or upgrade failures. Multi-AZ helps with availability, not upgrade safety.
Step-by-Step Summary
Here’s exactly what I did:
- Restored the latest snapshot into a new test database.
- Chose a smaller but similar instance class (no need for Multi-AZ in test).
- Waited a few minutes for it to spin up.
- Applied the PostgreSQL 16.9 upgrade.
- Waited about 12 minutes for the upgrade to complete.
- Verified everything was working.
- Deleted the test database.
- Upgraded the production database using the same method.
That’s it.
Simple, repeatable, and much safer than doing it blind.
What If Something Goes Wrong?
If you do find issues (which I’ve only seen in rare cases), especially with projects using:
- Custom functions
- PostgreSQL plugins or extensions
Then even restoring a snapshot may not help.
In those edge cases, I had to:
- Create a new RDS instance with the target version
- Manually migrate data and functions via SQL scripts
But again — this is rare. For most cases, upgrading on a test snapshot is enough.
Don’t Forget the Version Calendar!
Always check the version lifecycle of your database engine:
For example, PostgreSQL v16 is supported until February 2029, so plan your upgrades ahead of time.
Final Check: Production Upgrade ✅
After confirming the test upgrade worked, I did the same in production.
It took a few minutes, and everything went smoothly.
No downtime.
Website stayed up.
Dashboard worked.
Only a small bump in response time during the upgrade — totally acceptable.
Watch the Full Live Tutorial
If you want to see how I did it in real time, you can watch the video here:
🎥 Watch on YouTube
Thanks for reading! 🙌
I hope this helps someone, somewhere, somehow.
If you liked this post, feel free to share it, and subscribe to my channel for more tutorials like this.
See you in the next one — take care! 👋