cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
eac
Engaged Sweeper III
Please help me understand what am I doing wrong?
Because I was really hurt by the recent lost of my Lansweeper database that I couldn't successfully transfer to another server, I want to test a new installation followed by a data import...
Well, worthless to say that I didn't get it up and running 😞

So I'll tell you what are the steps I've did and I'll kindly ask you to tell me what am I doing wrong?

Thanks in advance!

1. Lansweeper service - stopped
2. IIS service - stopped
3. Lansweeper backup - copy entire installation folder to another location
4. LS Database backup - SQL backup to LS database
5. Uninstall Lansweeper
6. Delete LS Database from SQL server
7. Starting "recovery"
8. IIS service - started
9. Install Lansweeper on the same server as before
....a) used the same account for accessing SQL server (the same SQL server)
....b) used the same admin account in the First Run Wizard
....c) everything is working just fine
10.Lansweeper service - stopped
11.IIS service - stopped
12.Lansweeper restore - copy/overwrite the saved folder over the installation folder
13.LS Database restore - SQL restore of the LS database from the SQL backup
14.IIS service - started
15.Lansweeper service - started

All I'm getting now is 500 - Internal server error, an error I'm very familiar with...unfortunately...:(

I will not let for any reason Lansweeper run until I will not know exactly how to restore it from backup.
I know I'm doing something wrong, but what?

Well, there are people that are not meant to deal with some tools... OK, I can admit this easier then another unsuccessful restoration when the LS Database will be again by several hundreds of Megabytes.
...and sorry for the long post


All my respect for your work, but please let me understand where is the truth in this mater.

PS
Do you think that, in the future, a backup/restore function could be implemented in Lansweeper?

All the best!
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
You need to:
- Perform a full Lansweeper installation under SQL Server.
- Stop the Lansweeper and web server services.
- Restore your Lansweeper database backup in SQL Server Management Studio.
- Execute the database user script to reset the Lansweeper database user.
- Make sure your SQL instance name, database user and password are correct in the configuration files below.
Program Files (x86)\Lansweeper\Website\web.config
Program Files (x86)\Lansweeper\Service\Lansweeperservice.exe.config

- Execute the script below in SQL Server Management Studio and replace YourServer with the NetBIOS name of your scanning server.
use lansweeperdb
GO
update tsysasservers set servername='YourServer'
GO
update tblassets set scanserver='YourServer'
GO

- Restart the Lansweeper and web server services.

If you continue to have problems, contact support@lansweeper.com and provide us with:
- Screenshot of what you see when you access the error page on the server hosting your Lansweeper web console. Show us your entire browser window.
- Any install logs present in Program Files (x86)\Lansweeper\Install on your Lansweeper server.
- Program Files (x86)\Lansweeper\Service\Errorlog.txt.
- Program Files (x86)\Lansweeper\Service\Lansweeperservice.exe.config.
- Program Files (x86)\Lansweeper\Website\web.config.

View solution in original post

5 REPLIES 5
eac
Engaged Sweeper III
Now it's OK, thanks for help!
Hemoco
Lansweeper Alumni
You need to:
- Perform a full Lansweeper installation under SQL Server.
- Stop the Lansweeper and web server services.
- Restore your Lansweeper database backup in SQL Server Management Studio.
- Execute the database user script to reset the Lansweeper database user.
- Make sure your SQL instance name, database user and password are correct in the configuration files below.
Program Files (x86)\Lansweeper\Website\web.config
Program Files (x86)\Lansweeper\Service\Lansweeperservice.exe.config

- Execute the script below in SQL Server Management Studio and replace YourServer with the NetBIOS name of your scanning server.
use lansweeperdb
GO
update tsysasservers set servername='YourServer'
GO
update tblassets set scanserver='YourServer'
GO

- Restart the Lansweeper and web server services.

If you continue to have problems, contact support@lansweeper.com and provide us with:
- Screenshot of what you see when you access the error page on the server hosting your Lansweeper web console. Show us your entire browser window.
- Any install logs present in Program Files (x86)\Lansweeper\Install on your Lansweeper server.
- Program Files (x86)\Lansweeper\Service\Errorlog.txt.
- Program Files (x86)\Lansweeper\Service\Lansweeperservice.exe.config.
- Program Files (x86)\Lansweeper\Website\web.config.
eac
Engaged Sweeper III
...now I've found that for SQL2000, the "after restore script" has to be like this:
use lansweeperdb
GO
EXEC sp_dropuser lansweeperuser
go
execute sp_droplogin lansweeperuser
go
use master
GO
EXEC sp_addlogin 'lansweeperuser', 'mysecretpassword0*', 'lansweeperdb', [English]
GO
use lansweeperdb
go
EXEC sp_grantdbaccess 'lansweeperuser', 'lansweeperuser'
GO
EXEC sp_addrolemember [db_owner], 'lansweeperuser'
Go


Those errors running the script are because in SQL2000 the schema and the user wasn't separate yet.

Anyway, still helpless for me finding this 😞
eac
Engaged Sweeper III
Damn! Forget to add this to my steps list.

After SQL Database restore I've run
use lansweeperdb
GO
drop schema lansweeperuser
GO
drop user lansweeperuser
go
execute sp_droplogin lansweeperuser
go
use master
GO
EXEC sp_addlogin 'lansweeperuser', 'mysecretpassword0*', 'lansweeperdb', [English]
GO
use lansweeperdb
go
EXEC sp_grantdbaccess 'lansweeperuser', 'lansweeperuser'
GO
EXEC sp_addrolemember [db_owner], 'lansweeperuser'
Go

...and get this result:
Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'lansweeperuser'.
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'user'.
Login dropped.
New login created.
Msg 15023, Level 16, State 1, Procedure sp_grantdbaccess, Line 147
User or role 'lansweeperuser' already exists in the current database.
'lansweeperuser' added to role 'db_owner'.


It doesn't sound too successfully to me, but this is the result...
Anyway, running this script on the fresh installed database (the working one) it doesn't ruin it, despite those error messages.
stiwa
Champion Sweeper
Did you execute the scripts mentioned at http://www.lansweeper.com/kb/17/move-lansweeper-to-different-server.html ?