In this article will demonstrate complete BASIS/HANA DB steps “How to migrate SAP Apps and HANA DB to AWS/Azure cloud.
Tools are available for SAP Migration to Cloud, Cloud Endure (AWS), Azure Site Replication (ASR), Backup & restore, export and import and DB replication methodologies. The tool we’ve used is open source tool (RSYNC) for applications migration and DB replication (HSR).
Key notes: This is AS-IS migration. No changes on source end and assuming DB was already installed on AWS/Azure. (Refer below link how to install HANA Database)
https://help.sap.com/docs/SLTOOLSET/3aa4caa3bd634a22bdc572d82d1311ec/de681a8057a34bbfbf465b69feb910f9.html?version=CURRENT_VERSION
Complete steps for Migration:
TARGET System Preparation:
In Target : ./niping -s -I 0 -T trace_niping &
Application sync from Source to Target suing Rsync
Sync FS from on Prem to AWS/Azure Application Server for all
/usr/sap/
/sapmnt/<SID>
/usr/sap/DAA
/home/<SID>adm
/home/daaadm
/home/sapadm
NFS mount points
/usr/sap/trans
/sap/Interface
DB Readiness checks:
If you think there is some data to be synced on applications please re-run Rsync (Delta Sync)
Let us see how to perform HSR between source and Target.
Assuming that HANA Database is already installed on AWS/Azure with same version as of Source.
(HSR Replication from source to target works (lower to higher version) but not other way (higher to lower version replication does not work)
1) Enable replication from Source DB
hdbnsutil -sr_enable –name=SourceA
2) Verfiy the state of primary server
hdbnsutil -sr_state
3) Secondary (DB on AWS/Azure)
Check HANA is stopped
4) Secondary side: register (DB on AWS/Azure)
hdbnsutil -sr_register –name=TargetB –remoteHost=sourceDBHost –remoteInstance=$$ –replicationMode=async –operationMode=logreplay
5) Start Hana on Secondary
sapcontrol -nr $$ -function StartSystem HDB
6) Verify cluster
hdbnsutil -sr_state
7) check the replication status via Hana studio or python script
8) unregister replication on Target Database on AWS / Azure
hdbnsutil -sr_unregister
9) Stop Database and applications on-Premise
10) start HANA Database on AWS/Azure
sapcontrol -nr $$ -function StartService SID
sapcontrol -nr $$ -function StartSystem
Let us see how to perform RSYNC between source and target.
Look at below link how to install and configure RSYNC in case not present at OS
https://linuxize.com/post/how-to-use-rsync-for-local-and-remote-data-transfer-and-synchronization/
Sudo to root and execute below.
rsync -avhz –partial /home/<SID>/ <sid>adm@<Target IP>:/home/<sid>adm/
rsync -avhz –partial /usr/sap/<SID>/ <sid>adm @<Target IP>:/usr/sap/<SID>/
rsync -avhz –partial /sapmnt/<SID>/ <sid>adm @<Target IP>:/sapmnt/<SID>/
rsync -avhz –partial /usr/sap/DAA
/home/daaadm
-a, –archive, archive mode, equivalent to -rlptgoD. This option tells rsync to syncs directories recursively, transfer special and block devices, preserve symbolic links, modification times, groups, ownership, and permissions.
-z, –compress. This option forces rsync to compresses the data as it is sent to the destination machine. Use this option only if the connection to the remote machine is slow.
-v, –verbose increase verbosity
–h, –human-readable output numbers in a human-readable format
–progress show progress during transfer
1. ASCS & ERS Host ==> Requires Following file system
/home/<sid>adm
/usr/sap
/usr/sap/DAA
/usr/sap/<SID>/ASCS60
/usr/sap/<SID>/ERS70
/sapmnt/<SID> ==> common mount exists across all SAP Servers
2. Validate the FS on target server and verify the permissions with <sid>adm:sapsys after sync in /usr/sap.
3. Verify the host file and maintain “/etc/hosts” on DB ,Ascs, ERS, App and hard code the VIP hostname with physical host IP.
4. Append the entries to the file /etc/services
5. Change Environment variable files if <SID> is different in all APP servers
Go to /home/<sid>adm
ls –alt
egrep <SID> .sap* – change to target <SID> if SID is different
Chown –R <sid>adm:sapsys .sap*
Chown –R <sid>adm:sapsys *
Check the home path for <sid>adm,daaadm
Edit /usr/sap/sapservices accordingly
Make sure below slinks are working. If not exist please do create them
lrwxrwxrwx 1 sidadm sapsys 19 Nov 9 18:49 profile -> /sapmnt/<SID>/profile
lrwxrwxrwx 1 sidadm sapsys 18 Nov 9 18:49 global -> /sapmnt/<SID>/global
/usr/sap/<SID>/SYS/exe
lrwxrwxrwx 1 sidadm sapsys 18 Nov 9 18:50 uc -> /sapmnt/<SID>/exe/uc
lrwxrwxrwx 1 sidadm sapsys 19 Nov 9 18:55 nuc -> /sapmnt/<SID>/exe/nuc
lrwxrwxrwx 1 sidadm sapsys 30 Nov 9 18:56 dbg -> /sapmnt/<SID>/exe/uc/linuxx86_64
lrwxrwxrwx 1 sidadm sapsys 24 Nov 9 18:56 run -> /usr/sap/<SID>/SYS/exe/dbg
rsync – sync completion sample screenshot for /sapmnt/SID
Check HDB user store and update with required details
Start Databse
hdbuserstore SET DEFAULT DBHOSTNAME:35015 <schema> <Password>
sapcontrol -nr 00 -function StartService <SID>
sapcontrol -nr 00 -function Start
R3trans –d should return (0000)
Start app server/(s)
sapcontrol -nr $$ -function StartService <SID>
sapcontrol -nr $$ -function StartSystem
Please note that Start will start local instances whereas StartSystem will start all instances
Please like and share your feedback in comments and follow me for more blogs at Rajesh Azmeera