I’m using an Azure PostgreSQL database and need to perform a point-in-time restore (PITR) as part of a disaster recovery drill. I can successfully restore the database to a new server and update my application to point to this new server.
However, I’m deploying the database server using Infrastructure as Code (Terraform). After performing a PITR, I end up with a new server that is not represented in my Terraform code.
My questions are:
-
Is there a way to properly replace the existing server with the point-in-time data state while keeping my Terraform code in sync?
-
Should I delete the previous server after restoring, or is there a better approach to managing this situation with Terraform?
Any insights or best practices would be greatly appreciated!