How migrate a client from one server to another?

Migration guides for Secure Remote Worker and ThinKiosk. #MC-KB18

Written by Ines

Last published at: March 18th, 2024


Introduction

If you want to migrate a client from one server to another, (I.E. from a Cloud PoC to an OnPrem server)  follow these simple steps:


Delete

Important!

Please do not upgrade client versions prior to migration!


To move an existing device you can use the Migration Helper functionality inside the console to generate scripts or registry keys.



The generated information can be subsequently used in a software package.

In the examples, we will be utilizing the following to differentiate clients and servers:

  • Old server (that we're migrating from, version 3.1): http://TST-SRV-2016/
  • A new server (that we're migrating to, version 7.2): http://TST-SRV-OMEGA/ 
  • A new server (that we're migrating to, version 5.4): http://TST-SRV-CITADEL/ 
  • Existing client (to be migrated, version 5.3): TS-WS-WREX
  • Test client (to base the registry information of off, version 7.2): TS-WS-GARRUS



Versions < 7.0

1. The Migration Helper tool needs to be run off of the server you're migrating to. So on SERVER2019 start the Migration Helper and fill in the details:




2. We'll use the 64-bit Registry key generation, so click on the "Generate 64-bit registry file" button. You should get similar to the following information, so copy it to a notepad file:



6. On the old server, in this example TST-SRV-2016, we'll start our Package Creator:

7. Fill in the details like so:



Pre-Install Test:

Install Script:
We need the information we've saved in the notepad, now, so replace the values in red with the information from the notepad:



Option Explicit
Dim objWSHShell
Set objWSHShell = WScript.CreateObject("WScript.Shell")
Dim objWMIService, objItem, objService
Dim colListOfServices, strComputer, strService, intSleep
strComputer = "."
intSleep = 1000

If regValueExists("HKLM\SOFTWARE\WOW6432Node\ThinKiosk\ConnectionInfo\Moved") Then
Wscript.Echo "The registry does exists"
WScript.Quit
Else
Wscript.Echo "The registry key does not exists."

objWSHShell.RegWrite "HKLM\SOFTWARE\WOW6432Node\ThinKiosk\ConnectionInfo\MgmtUri", "yourserver", "REG_SZ"
objWSHShell.RegWrite "HKLM\SOFTWARE\WOW6432Node\ThinKiosk\ConnectionInfo\MgmtUsername", "yourusername", "REG_SZ"
objWSHShell.RegWrite "HKLM\SOFTWARE\WOW6432Node\ThinKiosk\ConnectionInfo\MgmtPassword", "yourpassword", "REG_SZ"
objWSHShell.RegWrite "HKLM\SOFTWARE\WOW6432Node\ThinKiosk\ConnectionInfo\Moved", "Yes", "REG_SZ"

strService = " 'SecureRemoteWorkerMachineService' "
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name ="_
& strService & " ")
For Each objService in colListOfServices
objService.StopService()
WScript.Echo "The " & strService & " service has been stopped"
WScript.Sleep intSleep
objService.StartService()
Next
WScript.Echo "The " & strService & " service has Started"
WScript.Quit
End If


Function regValueExists (key)
'This function checks if a registry value exists and returns True of False
On Error Resume Next
Dim oShell
Set oShell = CreateObject ("WScript.Shell")
regValueExists = True
Err.Clear
oShell.RegRead(key)
If Err <> 0 Then regValueExists = False
Err.Clear
Set oShell = Nothing
End Function


8. Save the package and load it into your Software Package list, then assign it as any other package:




9. Right-click the device and choose Device > Refresh + Restart and observe the change on the machine.
10. Once it restarted again, check your new server, in this case, the OMEGA server, and refresh the folder where your device should have landed. The device is there:



Delete

Versions 7.0 and newer

1. On your old server, open notepad.exe on your server and use the silent installation commands from this article: https://kb.thinscale.com/thinkiosk-knowledge-base/thinkiosk-silent-installation

You generally require the Registration key from the Access Key:


This is what we are looking to get:

@echo off


cd "C:\Program Files (x86)\ThinKiosk"
ThinKiosk.setup.exe /install CONNECTIONTYPE=0 MGMTURI=http://TST-SRV-OMEGA/TSTMgmt MGMTACCESSKEY=05122954dfd742b483379178b4c5ec13cdb52cfe7dc14a1d978546ce47fa54db UILEVEL=1


exit

We're calling an existing exe in the ThinKiosk installation folder, and then providing the parameters required for reconfiguration, which are the Management URI, and the Access Key's Registration key. The UILEVEL=1 means that we're looking for a completely silent installation.

Save the notepad as reconfigure.bat somewhere on the server.

2. Still on the old server, we'll now start the Package Creator from the ribbon bar:


7. Fill in the details like so:


In the install files, we add the reconfigure.bat:


The Pre-install tests and conditions are empty, so we'll simply move on the Install Script. Use the following:

	
On Error Resume Next
	
Set objShell=CreateObject("WScript.Shell")
	
objShell.Run "reconfigure.bat",0,True
	
WScript.Quit()
	

8. Save the package and load it into your Software Package list, then assign it as any other package:



9. Right-click the device and choose Device > Refresh + Restart and observe the change on the TK machine.
10. Once it restarted again, check your new server, in this case, the OMEGA server, and refresh the folder where your device should have landed. The device is there:



Delete