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?

feita há um ano1769 visualizações
2 Respostas
0
Resposta aceita

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.

ESPECIALISTA
respondido há um ano
profile picture
ESPECIALISTA
avaliado há um ano
  • 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
ESPECIALISTA
respondido há um ano
  • That's a great suggestion. However, the "Upgrade snapshot" option is greyed out and there is a note on the page that says "You can't upgrade automated DB snapshots that are created during the automated backup process."

    Unfortunately, I only have automated backups --- the last manual snapshot is too old to be useful :(

  • OK, I copied the automated snapshot, which created a manual snapshot. Then I tried to upgrade it, but under the "New engine version" field, the dropdown list is empty, and there's a message below stating "No upgrades are available for the snapshot at this time."

  • Thanks for raising this, I think I need to revisit how restorable our compliance backups (up to 7 years old) really are.

    https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBSnapshot.PostgreSQL.html says "For the list of engine versions that are available for upgrading a DB snapshot, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.PostgreSQL.html#USER_UpgradeDBInstance.PostgreSQL.MajorVersion".

    There, it doesn't list anything older than 9.6.1.

    This smells bad to me, I'm going to raise a support case and escalate as needed. I'll comment back here if I find out more.

  • Oof, missed by a few engine versions :) Thank you for raising a support case; that's very kind of you. Please let me know if you find out anything.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas