Skip to content

Backup and Restore

During the backup, ensure that clusters are fully provisioned and not in-progress. Follow the below steps to restore the current database with a new controller.


Restore

Prerequisites

  1. Make sure the database and velero is backed up
  2. Make sure the existing Database is reachable from the new Cluster Resource

Procedure

  • Create new storage account and storage container to save terraform state files

  • Update the existing Database FQDN in terraform.tfvars

existingDatabaseFQDN = ""

Existing database FQDN should be provided in case of using existing database

  • Update the existing db value in terraform.tfvars

existingDatabase = true

  • Create a new Resource group, Virtual Network, Aks Cluster

  • Store the password using the pass command (Refer to 2.3.1) and pass the secrets using pass and set as environment variables

  • Enable Restore option in Velero in terraform.tfvars

velero_restore = true

  • Initialize the terraform code and run it
terraform init \
-backend-config="resource_group_name=$TF_STATE_FILE_STORAGE_RESOURCE_GROUP" \
-backend-config="storage_account_name=$TF_STATE_FILE_STORAGE_ACCOUNT" \
-backend-config="container_name=$TF_STATE_FILE_STORAGE_CONTAINER" \
-backend-config="key=terraform.tfstate"
  • Create a plan of what resources are going to be executed in the AKS console

terraform plan

  • Apply and create infrastructure to bring up the Rafay controller

terraform apply --auto-approve

Once the terraform command gets completed, you should be able to login into the URL https://console.<controller-FQDN> using the username and password of the old controller.

  • Verify if the existing clusters become healthy in 10-20 mins