This blog explains how to move an existing SAPMNT share from one location to another. It can be used in Failover cluster configurations, distributed environments or even on standard installations, if you want to change the hostname used for “SAPGLOBALHOST”.
Example:
Your SAP system uses a SAPMNT share on host “old”. The profile parameter SAPGLOBALHOST is set to “old”.
You want to use a different hostname “new” as host for SAPMNT share.
In this blog I will describe the manual steps to change “old” in “new”. I use a Failover cluster configuration to show all necessary steps. If you skip the cluster related changes, you can use the same manual steps also for a distributed or standard installation.
Source configuration
We have a clustered ASCS instance with SAP SID “ABC” which uses “ascs-abc” as SAPLOCALHOST hostname and “old” for SAPGLOBALHOST:
SAPMNT is a share on host “old” and this is its content:
C:>net view \old Shared resources at \old Share name Type Used as Comment ------------------------------------------------------------------------------- sapmnt Disk The command completed successfully.
C:>dir \oldsapmntabc Volume in drive \oldsapmnt has no label. Volume Serial Number is 205D-2675 Directory of \oldsapmntabc 05/25/2022 02:48 PM <DIR> . 05/25/2022 02:46 PM <DIR> .. 05/25/2022 02:48 PM <DIR> ASCS00 05/25/2022 02:46 PM <DIR> SYS
Depending on your configuration (cluster configuration or distributed), sapmnt share consists only of sys folder or even additional folders, like trans …)
This content must be moved to the new location which should be in this example: \newsapmnt
Preparation
Before I stop the system and change the configuration, I have to do these steps in advance:
a) Prepare the new location. In case you only want to rename SAPGLOBALHOST, then you can skip this step. Prepare means, that the new network location is available, the share is available and all the content from old share has been copied to the new share.
If you want to copy SAP directories from one location to another, always use ROBOCOPY or similar tool to be sure, that the ACLs of the directories and files are copied.
Robocopy example:
ROBOCOPY /E /MIR /SEC /SECFIX <Source> <Target> /R:1 /W:1
b) In our example I want to use host “new” for SAPGLOBALHOST
Configuration phase
In this phase we have to stop the whole SAP system to be able to change its configuration.
1. Stop the SAP system, stop all instances and stop the SAP services.
In case of a clustered configuration, stop all resources in Failover Cluster Manager, first.
SAP MMC should not show any green instance for system “ABC”. Don’t forget to stop ERS instances (cluster configuration …)
Stop the SAP services manually in Service Control Manager, for example the ERS service(s)
2. Check, if the new location and the share sapmnt is really available:
C:>dir \newsapmntabc Volume in drive \newsapmnt has no label. Volume Serial Number is 205D-2675Directory of \newsapmntabc05/25/2022 02:48 PM <DIR> . 05/25/2022 02:46 PM <DIR> .. 05/25/2022 02:48 PM <DIR> ASCS00 05/25/2022 02:46 PM <DIR> SYS
3. Edit all profiles and look for entries with old hostname, replace it with the new hostname.
4. Open Registry Editor (regedit) and change the SAP services ImagePath to reflect the new location:
Old configuration:
New configuration:
Do this on all cluster nodes.
5. Copy the ERS profiles from central profile directory on sapmnt to the local ERS profile directory.
Only ERS instances have an own profile directory.
copy \newsapmntabcsysprofileABC_ERS* to \<clusternode>saplocabcers<nr>profile
Do this on all cluster nodes.
6. Change the environment variables:
Log on via RDP using <SID>adm user. Open System Properties -> Environment Variables
Look for all entries with old hostname and change them with the new hostname.
Example:
You have to change all user environment variables of <SID>adm user AND the system environment variables, as well!
7. In case you use symbolic directory links to \<SAPGLOBALHOST>sapmnt, the must be deleted and new create with the correct location.
In this example I have a file-share-cluster and the local share “SAPLOC” contains several symbolic directory links that point to \oldsapmnt:
C:usrsapABCASCS00>dir Volume in drive C has no label. Volume Serial Number is 4C69-E495Directory of C:usrsapABCASCS0005/25/2022 02:48 PM <DIR> . 05/25/2022 02:49 PM <DIR> .. 05/25/2022 02:48 PM <SYMLINKD> data [\oldsapmntABCASCS00data] 05/25/2022 02:49 PM <DIR> exe 05/25/2022 02:48 PM <SYMLINKD> log [\oldsapmntABCASCS00log] 05/25/2022 02:48 PM <SYMLINKD> sec [\oldsapmntABCASCS00sec] 05/27/2022 10:58 AM <DIR> work
and
C:usrsapABC>dir Volume in drive C has no label. Volume Serial Number is 4C69-E495Directory of C:usrsapABC05/25/2022 02:49 PM <DIR> . 05/25/2022 02:46 PM <DIR> .. 05/25/2022 02:48 PM <DIR> ASCS00 05/25/2022 02:49 PM <DIR> ERS10 05/25/2022 02:48 PM <SYMLINKD> SYS [\oldsapmntABCSYS] 05/27/2022 10:58 AM <DIR> tmp
Delete these links and recreate them with the new location.
Example for SYS link:
C:usrsapABC>mklink /d sys \newsapmntABCSYS symbolic link created for sys <<===>> \newsapmntABCSYS
Result: C:usrsapABC>dir Volume in drive C has no label. Volume Serial Number is 4C69-E495Directory of C:usrsapABC05/27/2022 11:15 AM <DIR> . 05/25/2022 02:46 PM <DIR> .. 05/25/2022 02:48 PM <DIR> ASCS00 05/25/2022 02:49 PM <DIR> ERS10 05/27/2022 11:15 AM <SYMLINKD> sys [\newsapmntABCSYS] 05/27/2022 10:58 AM <DIR> tmp
8. Start the SAP services using Service Control Manager (or via PowerShell / command prompt):
Open Failover Cluster Manager and start the instance (or use SAP MMC):
9. Test failover of SAP cluster group.
10. Start all other instances (ERS, PAS, AAS …)
Troubleshooting
In case a service doesn’t start anymore, check Windows Event Viewer (eventvwr) => application log. Look for events from SAP start service (sapstartsrv).
Possible problems:
- no permissions to load the profile from \<SAPGLOBALHOST>sapmnt share
- typo in the service “ImagePath” file path during change with Registry Editor
- ACLs are not copied properly from old sapmnt to new sapmnt
- SAPGLOBALHOST is not available … (check with net view \<SAPGLOBALHOST>)