How can I restore a failed RDS DB from a snapshot if it uses a deprecated engine version of PostgreSQL?

0

I got an email from AWS that my RDS DB instance that was using deprecated PostgreSQL version 9.3.25 and deprecated instance class db.m1.small has now been put in a "failed" state. The email suggests that I should restore it from a snapshot using a new instance class. However, none of the new instance classes seem to allow engine version 9.3.25 and there doesn't seem to be any option to simultaneously upgrade the engine version while restoring.

Is there any way to do this?

asked a year ago1532 views
2 Answers
0
Accepted Answer

Sorry for the delay, but I have an answer from AWS Support now. Not what I expected at all - restoring via CLI actually works!

I've just restored an old Postgres 9.3.5 snapshot successfully using:

aws rds restore-db-instance-from-db-snapshot
--db-instance-identifier mynewdbinstance
--db-snapshot-identifier mydbsnapshot
--db-subnet-group mysubnetgroup

See https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-from-db-snapshot.html

Mine immediately auto-upgraded to 9.3.25 which right now is still in progress. It may auto-upgrade straight away all the way to v12, or that might happen later if I don't upgrade manually to something else. Note sure yet.

EXPERT
answered a year ago
profile picture
EXPERT
reviewed 8 months ago
  • Thank you so much for looking into this. For some reason, this is still not working for me. If I just run your command, it gives the following error:

    "An error occurred (InvalidParameterCombination) when calling the RestoreDBInstanceFromDBSnapshot operation: RDS does not support creating a DB instance with the following combination: DBInstanceClass=db.m1.small, Engine=postgres, EngineVersion=9.3.25, LicenseModel=postgresql-license. For supported combinations of instance class and database engine version, see the documentation."

    Of course, this is because DBInstanceClass db.m1.small is now deprecated. But even if I add "--db-instance-class db.m6i.large" or something to the command, I still get the same error with the new instance class. For some reason, it's still trying to restore with EngineVersion 9.3.25.

    I also tried using AWS CLI to upgrade the snapshot version using modify-db-snapshot, but it says:

    "An error occurred (InvalidParameterCombination) when calling the ModifyDBSnapshot operation: You can't upgrade the DB snapshot from the engine version 9.3.25 to 12.6."

    Any ideas as to what I'm doing wrong?

  • My 9.3.5 DB restored and immediately upgraded to 9.3.25, where it's stopped for now, so I think yours restoring as 9.3.25 is fine.

    Have a look at https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html - it looks like db,m6i won't work with 9.3. Mine restored to db.r3 OK, which according to that table makes sense.

  • Oh wow. That did the trick. Somehow AWS wasn't picking db.r3 automatically for me. I tried a whole bunch of instance classes, but none worked. After looking at your comment, I tried adding "--db-instance-class db.r3.large" manually and IT RESTORED! I can't thank you enough, good-hearted stranger :)

  • No problem, glad to help! It's been useful for us too to verify how restorable our compliance backups are. If you get around to it, it would be great if you could hit "Accept" on my answer, thanks.

  • Update - here's a blog article about this after more investigation and feedback from AWS. https://www.linkedin.com/pulse/can-you-really-restore-all-those-old-aws-rds-database-steve-kinsman

    Part 2 will be published soon.

0
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions