Notifications

13 views

Description


You may need to move the MID Server installation folder to a different folder or disk on the same host server. Valid reasons might be:

  • You need to move it to another disk due lack of disk space, perhaps for the Export Sets feature which must save files within the install folder
          e.g. C:\ServiceNow_MID_Servers\Prod_Disco_MID\agent\ -> D:\ServiceNow_MID_Servers\Prod_Disco_MID\agent\
  • When you extracted the install ZIP file, you ended up with the zip file name as part of the folder name (easy mistake to make with Windows explorer).
          e.g. C:\Prod_Disco_MID\mid.madrid-12-18-2018_01-07-2019_0000.windows.x86-64\agent\ -> C:\Prod_Disco_MID\agent\
  • You installed within a user profile, such as on the user's Desktop, which doesn't work well.
          e.g. C:\Users\Dave\Desktop\agent\ -> C:\ServiceNow_MID_Servers\Prod_Disco_MID\agent\
  • ...and maybe others

 This is possible, and I will leave it up to you to decide if this is more hassle than just installing a new one in the right place.

Procedure


The only place a full path to a MID Server installation exists on the host is in the Registry keys that define the Windows Service. This procedure is based on manually moving the installation folder, and then updating the Windows Registry for the Windows Services to match the folder change.

The MID Server will have to be stopped while the change is made. You can't move files that are in use.

Warning: Any out-of-box code will use relative paths, relative to the agent folder.  This procedure assumes all custom code also uses relative paths. e.g. Powershell script locations in Orchestration activities, Export Set file paths, etc..

  1. Stop the relevant Services
    1. ServiceNow MID Server 
      1. Open the Services Control Panel applet. Run: services.msc
      2. Find the main MID Server service, and open it. 
        If the MID Server is named "Prod Disco MID" in the instance, and it was installed using the installer.bat installer, then:
        Display name: "ServiceNow MID Server_Prod Disco MID"
        Service name: "snc_mid_Prod Disco MID"
      3. Record the Service name
      4. Confirm the Path to executable matches what you thought it was. If not you may be looking at the wrong MID Server Service.
      5. Stop the MID Server Service
    2. WMI Collector Service
      1. Find the WMI Collector Service. By default there is one, regardless of how many MID Servers are installed. There may be more than one. There may be none if you don't use any Discovery products, in which case ignore this bit.
      2. Open each in turn until you find the one using the same agent folder in the Path to executable as your MID Server Service above
      3. If there is only one, then the names are:
      4. Display name: "ServiceNow WMI Collector"
        Service name: "ServiceNow WMI Collector"
      5. Record the Service name
      6. Stop that WMI Collector Service, but only if it is using the binaries from this same MID Server install folder.

  1. Move the installation folder
    1. Copy the agent folder. Don't try and actually move it, as you will almost certainly have file locks.
    2. Paste it where you want it. 
    3. Record the new path to the agent folder.
    4. Delete the old folder. If Windows prevents you deleting some files, check you don't have any logs open. You may also need to stop other MID Server services which are sharing the WMI Collector Service. You may need to restart the host server to free up the locks.
  2. Modify the Registry
    1. Open the Registry Editor. Run: regedit.exe
    2. Open this Key: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
    3. Find the keys within that with the Service Names of the ServiceNow MID Server service, and WMI Collector service.
    4. For each service 
      1. Click the key, to display the data on the right side of the screen
      2. Edit the ImagePath value to change the path. The main service value has the path in twice, so don't forget to modify both paths in the value.

  1. Start the Services
  2. On the MID Server form in the instance, and yo uwill see the following error. Open the MID Server Issue record and set it as Resolved. 
    "The home directory changed from C:\MID_SERVER\Prod_Disco_MID\agent to C:\MID_SERVER\agent. This issue must be manually resolved."

Applicable Versions


Any, where a Windows hosted MID Server is installed. Versions prior to Geneva will not have a WMI Collector Service.

Article Information

Last Updated:2019-01-11 06:56:03
Published:2019-01-08