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?

已提問 1 年前檢視次數 1769 次
2 個答案
0
已接受的答案

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.

專家
已回答 1 年前
profile picture
專家
已審閱 1 年前
  • 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
專家
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南