cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rtaylor
Engaged Sweeper II
Lansweeper version 7.2.105.2, using the SQL Compact database.
I followed the instructions here https://www.lansweeper.com/knowledgebase/move-lansweeper-to-different-server/ to migrate our installation to a new server. The new server has a different name.
Once the migration was complete, under Scanning Targets I have both the old server and the new server. I have not found a way to move all the scan targets from OldServer to NewServer. Does a way exist?
4 REPLIES 4
rtaylor
Engaged Sweeper II
Thank you both. I won't get back to this until this weekend, but I'll post my results.

Ray
mwrobo09
Champion Sweeper
I am not as comfortable running scripts on the DB, so when I make a change to a scan server, I do the following.

1. Click on the Assets tab off the main bar.
2. Then Scroll all the way over to the right and type the name of the old server into the scanserver field.
3. Then check the box next to the name field to select all devices to select everything on the page.
4. Click the Edit Fields action on the left.
5. Change the box that says no field selected to scanserver, then in the other box, select your new sever.
6. If there is more than 250 devices on that server you may have to do it again, to make sure all of them transfer.

Esben_D
Lansweeper Employee
Lansweeper Employee
The script below which you can run via SQL Server Management Studio (once per old/new server combo), that will transfer the configuration from one "old server" to one "new server", and update the scanserver value for existing related assets. You will need to modify the NewServer values with the NetBIOS name of your new server and OldServer with the NetBIOS name of your old server (name as shown in the web console).

Also, just to be safe, it's probably best to make sure you have a recent database backup.

Use Lansweeperdb
/* deletes the empty record of the new server, replace NewServer with the NetBIOS name of your new server (as seen in the web console) */
delete from tsysasservers where servername = 'NewServer'
GO
/* Renames your old server to the name of your new server, effectively transferring configuration. Replace NewServer with the NetBIOS name of your new server and OldServer with the NetBIOS name of your old server (as seen in the web console) */
update tsysasservers set servername = 'NewServer' where servername = 'OldServer'
GO
/* Moves the assets scanned by the old server to the new server, replace NewServer with the NetBIOS name of your new server and OldServer with the NetBIOS name of your old server (as seen in the web console) */
update tblassets set scanserver = 'NewServer' where scanserver = 'OldServer'
GO

Hello, we have a similar issue, except we are getting the following error below when trying to run the script any suggestions to fix the issue?

The DELETE statement conflicted with the REFERENCE constraint "FK_tblLsAgentRelayConfig_tsysASServers". The conflict occurred in database "lansweeperdb", table "dbo.tblLsAgentRelayConfig", column 'Servername'.
The statement has been terminated.
Violation of PRIMARY KEY constraint 'PK_tsysASServers'. Cannot insert duplicate key in object 'dbo.tsysASServers'. The duplicate key value is (***NEW SERVER NAME***).