How to move SAPMNT share to a different SAPGLOBAL-Host?
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”.
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.
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 \\old\sapmnt\abc Volume in drive \\old\sapmnt has no label. Volume Serial Number is 205D-2675 Directory of \\old\sapmnt\abc 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: \\new\sapmnt
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 /E /MIR /SEC /SECFIX <Source> <Target> /R:1 /W:1
b) In our example I want to use host “new” for SAPGLOBALHOST
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 \\new\sapmnt\abc Volume in drive \\new\sapmnt has no label. Volume Serial Number is 205D-2675Directory of \\new\sapmnt\abc05/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:
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 \\new\sapmnt\abc\sys\profile\ABC_ERS* to \\<clusternode>\saploc\abc\ers<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.
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 \\old\sapmnt:
C:\usr\sap\ABC\ASCS00>dir Volume in drive C has no label. Volume Serial Number is 4C69-E495Directory of C:\usr\sap\ABC\ASCS0005/25/2022 02:48 PM <DIR> . 05/25/2022 02:49 PM <DIR> .. 05/25/2022 02:48 PM <SYMLINKD> data [\\old\sapmnt\ABC\ASCS00\data] 05/25/2022 02:49 PM <DIR> exe 05/25/2022 02:48 PM <SYMLINKD> log [\\old\sapmnt\ABC\ASCS00\log] 05/25/2022 02:48 PM <SYMLINKD> sec [\\old\sapmnt\ABC\ASCS00\sec] 05/27/2022 10:58 AM <DIR> work
C:\usr\sap\ABC>dir Volume in drive C has no label. Volume Serial Number is 4C69-E495Directory of C:\usr\sap\ABC05/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 [\\old\sapmnt\ABC\SYS] 05/27/2022 10:58 AM <DIR> tmp
Delete these links and recreate them with the new location.
Example for SYS link:
C:\usr\sap\ABC>mklink /d sys \\new\sapmnt\ABC\SYS symbolic link created for sys <<===>> \\new\sapmnt\ABC\SYS
Result: C:\usr\sap\ABC>dir Volume in drive C has no label. Volume Serial Number is 4C69-E495Directory of C:\usr\sap\ABC05/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 [\\new\sapmnt\ABC\SYS] 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 …)
In case a service doesn’t start anymore, check Windows Event Viewer (eventvwr) => application log. Look for events from SAP start service (sapstartsrv).
- 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>)