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?

질문됨 일 년 전1699회 조회
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.

전문가
답변함 일 년 전
profile picture
전문가
검토됨 10달 전
  • 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
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠