Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

Note!

The instructions for backup and upgrade of the database below are only relevant if you are using RDS Azure Database as platform database. If the platform database used is derby, the backup of the EFS Azure Storage covers the database as well (assuming persistent storage of the platform is enabled).

  1. List the databases and locate the one used for Usage Engine with this command:

    Code Block
    aws rds describe-db-instances --query 'DBInstances[].DBInstanceIdentifier[]'
  2. Perform a backup of the RDS database with this command:

    Code Block
    aws rds create-db-snapshot --db-snapshot-identifier <database backup name> --db-instance-identifier <database instance name>

    for example:

    Code Block
    aws rds create-db-snapshot --db-snapshot-identifier uepe-eks-db-postgresql-backup --db-instance-identifier uepe-eks-db-postgresql
  3. Check if the backup was created successfully by running this command:

Code Block
aws rds describe-db-snapshots --snapshot-type manual --db-snapshot-identifier uepe-eks-db-postgresql-backup

It is now time to do a backup of the file system used.

Note

Note!

If there are standalone ECs that are still running and writing their logs to the same EFS, whatever happens after the backup has been initiated will not be included in the backup.

To create an EFS backup using the console, see https://docs.aws.amazon.com/aws-backup/latest/devguide/recov-point-create-on-demand-backup.html for instructions.

The section below contains an example of how to run an on-demand backup job using the command line. The snapshot will in this case be stored under the default backup vault.

Code Block
export EFS_NAME=uepe-eks-efs-disk
export EFS_FILE_SYSTEM_ID=$(aws efs describe-file-systems --query "FileSystems[?Name==\`$EFS_NAME\`].FileSystemId" --output text)
export EFS_ARN=$(aws efs describe-file-systems --query "FileSystems[?Name==\`$EFS_NAME\`].FileSystemArn" --output text)
export VAULT_NAME=Default
export BACKUP_ROLE_ARN=$(aws iam get-role --role-name AWSBackupDefaultServiceRole --query "Role.Arn" --output text)

# Run on demand backup job
aws backup start-backup-job \
--backup-vault-name $VAULT_NAME \
--resource-arn $EFS_ARN \
--iam-role-arn $BACKUP_ROLE_ARN

# View backup job status
aws backup list-backup-jobs --by-resource-type EFS

Restoring from Backup

If restoring becomes necessary, you can restore the DB instance from a snapshot backup, see the AWS guide For database backup, please refer to https://learn.microsoft.com/en-us/azure/backup/backup-azure-database-postgresql-flex for guidance.

It is now time to do a backup of the file system used.

Note

Note!

If there are standalone ECs that are still running and writing their logs to the same EFS, whatever happens after the backup has been initiated will not be included in the backup.

To create an EFS backup using the console, see https://docs.aws.amazon.com/AmazonRDSaws-backup/latest/UserGuide/USER_RestoreFromSnapshotdevguide/recov-point-create-on-demand-backup.html for more information. You can also restore a new DB instance using the commands below:instructions.

The section below contains an example of how to run an on-demand backup job using the command line. The snapshot will in this case be stored under the default backup vault.

Code Block
export EXISTINGEFS_DBNAME=uepe-eks-dbefs-postgresqldisk
export NEW_DB=uepe-eks-db-postgresql-2
export SNAPSHOT=uepe-eks-db-postgresql-backup
export INSTANCE_CLASS=db.t3.small
export SUBNET_GROUP_NAMEEFS_FILE_SYSTEM_ID=$(aws efs describe-file-systems --query "FileSystems[?Name==\`$EFS_NAME\`].FileSystemId" --output text)
export EFS_ARN=$(aws rdsefs describe-dbfile-instancessystems --query "DBInstancesFileSystems[?DBInstanceIdentifierName==\`$EXISTING`$EFS_DBNAME\`].DBSubnetGroup.DBSubnetGroupNameFileSystemArn" --output text))
export VAULT_NAME=Default
export SECURITYBACKUP_GROUPROLE_IDARN=$(aws iam rdsget-role describe--dbrole-instancesname AWSBackupDefaultServiceRole --query "DBInstances[?DBInstanceIdentifier==\`$EXISTING_DB\`].VpcSecurityGroups[].VpcSecurityGroupIdRole.Arn" --output text)

# Run on demand backup job
aws rds restore-db-instance-from-db-snapshotbackup start-backup-job \
--dbbackup-instancevault-identifiername $NEW$VAULT_DBNAME \
--dbresource-snapshot-identifier $SNAPSHOTarn $EFS_ARN \
--dbiam-instancerole-classarn $INSTANCE_CLASS \
--db-subnet-group-name $SUBNET_GROUP_NAME \
--vpc-security-group-ids=$SECURITY_GROUP_ID

If you are using the console to do the RDS restore, remember to include the existing database security group so that it can be accessible by the cluster.

...

$BACKUP_ROLE_ARN

# View backup job status
aws backup list-backup-jobs --by-resource-type EFS

Restoring from Backup

If restoring becomes necessary, you can restore the recovery point into Azure Blob Storage and use DB native tools pg_restore to restore data as a new PostgreSQL flexible server, see Azure guide https://learn.microsoft.com/en-us/azure/backup/restore-azure-database-postgresql-flex for more information.

To restore EFS, follow the instructions in https://docs.aws.amazon.com/aws-backup/latest/devguide/restore-resource.html and https://repost.aws/knowledge-center/aws-backup-restore-efs-file-system-cli.

...