Backup and recovery
In the case of an emergency, restore your databases
Read time 1 minuteLast updated 6 days ago
These best practices are critical for any system:
- Store backups
- Set up a recovery plan
Restore the Keycloak database
Keycloak persists the following data in Amazon Relational Database Service (RDS) Postgres:- Users
- Roles
- Sessions
- Events
-
Go to the Amazon RDS console and complete these steps:
- Go to Automated Backups.
- Select the Keycloak database instance, and then select Actions > Restore to point in time.
-
Specify the recovery parameters:
- Select the desired time.
- Enter a database instance modifier, for example, .
asset-solutions-postgres-restored
- Select Restore to point in time.
-
In the console application, complete these steps:
-
To remove the current RDS instance from the Terraform state, run the following command within the directory:
aws/terraform/
terraform state rm aws_db_instance.asset-solutions-postgres
-
To import the newly restored RDS instance, run this command:
terraform import -var-file tfvars/us-east-1.tfvars aws_db_instance.asset-solutions-postgres asset-solutions-postgres-restored
-
Optionally, to avoid a naming conflict, rename the database in the file or remove the old instance
postgres.tf
.asset-solutions-postgres
- To apply the Terraform plan, run this command:
make apply
-
To remove the current RDS instance from the Terraform state, run the following command within the