AWS BackInt — SAP System Copy

Sagar Donthineni
4 min readMay 29, 2021

--

In my previous blog, I discussed about AWS BackInt Agent for HANA installation steps and backup procedure. If you did not get a chance to check my previous blog check here.

In this blog, I will discuss how to proceed in case of a SAP System Copy or System refresh using database backup and restore method.

AWS BackInt Agent for HANA Architecture

AWS BackInt Agent redirect restore Scenarios

  1. SAP System Copy — Creating a new SAP system using source system backup.
  2. SAP Database Refresh — Refreshing existing SAP system with source system backup.

Prerequisites

  1. Source and target system must have AWS BackInt installed and configured.
  2. Backup must have taken using AWS BackInt and stored in S3 default path created by AWS BackInt Agent.
  3. The target system must have appropriate access to S3 bucket where source system database backups are stored.
  4. If source and target systems are in different AWS accounts, explicitly allow the AWS IAM role (IAM role attached to target HANA ec2 instance) ARN in source S3bucket permissions to allow target ec2 instance to get the backups from S3.

Procedure

Below are the steps with brief description;

  1. Suspend backup on target HANA system including log backups.
  2. Navigate to the BackInt installation folder, default installation location is /hana/shared/aws-backint-agent and create a backup for the file aws-backint-agent-config.yaml
  3. Next step is to edit the contents of the BackInt config file, this is to enable target systems read source system backups from the source s3 bucket, this can be done either editing the config file directly or copying the config file from source system. example aws-backint-agent-config.yaml after changing.
S3BucketAwsRegion: "<aws region>" 
S3BucketName: "<SourceBucketName>"
S3BucketFolder: "<prefixfolder>"
S3BucketOwnerAccountID: "<Source S3 Bucket AWS account ID>"
LogFile: "/hana/shared/aws-backint-agent/aws-backint-agent.log" S3SseEnabled: "true"

4. ** At this point you need to take extra care backups are disabled on target system, else target system backups can land in source system bucket. Best practice is, not to grant “putobject” permission to target system in S3bucket policy. If encryption is used using CMK, the target system must have appropriate permission to the CMK.

5. Get the source system backup ID, one way of getting it is from source system SAP DB13 t-code, if backups scheduled via DB13 in source system.

DB13-ScreenShot-masked hostname & SID

6. Logon to target system and stop your SAP application services, stop target tenant Database with below command; Let us use SID of tenant Database as TGT.

ALTER SYSTEM STOP DATABASE TGT

Alternatively you can also use HANA studio to stop Database.

7. Now execute below command to make sure TGT system has access to S3 Bucket. Here let us use SRC as SID of source system and TNT as tenant Database of SRC.

aws s3 ls <S3BucketName>/<folderPrefix>/SRC/usr/sap/SRC/SYS/global/hdb/backint/DB_TNT/

8. Use below command to start database recovery, either using hdbsql or HANA studio.

RECOVER DATA FOR TGT USING SOURCE 'SRC@TNT' USING BACKUP_ID 1622024422213  USING CATALOG BACKINT USING DATA PATH ('/usr/sap/SRC/SYS/global/hdb/backint/DB_TNT/') CLEAR LOG

9. To check the recovery status, navigate on HANA system to /hana/shared/TGT/HDB00/<targethostname>/trace/DB_TNT and check backup.log file.

backup.log contents

In above recovery scenario backup size was roughly 120GB, it took around 10 minutes to complete the recovery from S3*.

Above recovery performed on r5.8xlarge ec2 instance with VPC endpoints to S3 (Instance and S3 bucket belongs to same region).

*Speed of recovery and backup using AWS BackInt agent depends on various factors like EC2 instance size, available resources, communication to S3 (using endpoint, NATGateway/NAT instance etc.).

10. Now proceed with SAP system specific post system copy /pos restore activities.

11. Do not forget to restore the AWSBackInt configuration file from backup file as discussed in step #2 and enable backups.

Conclusion

When we compare with expensive license costs generally associated with BackInt softwares for SAP backup, AWS BackInt agent is real winner here, offered by AWS for free of cost.

Instead of using custom scripts and local storage, using AWS BackInt agent for SAP HANA makes perfect sense to manage SAP HANA backup and restore use cases. The best part is, this can be deployed and managed using AWS Systems manager and all of it for free of cost.*

*Only AWS BackInt agent is free, however underlying resources like ec2, s3 etc. are billed according to AWS pricing.

References

--

--