cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cansaydam
Engaged Sweeper
Hi,

Can I change the database location for the lansweeper?

Thanks

Jon Saydam
7 REPLIES 7
cansaydam
Engaged Sweeper
Thank you so much! It worked for me..

Regards

Jon
stiwa
Champion Sweeper
i had to do this recently with another database.
just stop lansweeper service, connect with sql server management studio to the database and execute the code:

USE master;
GO
ALTER DATABASE lansweeperdb SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE lansweeperdb SET OFFLINE;
GO
-- Physically move the file to a new location.
-- In the following statement, modify the path specified in FILENAME to
-- the new location of the file on your server.
ALTER DATABASE lansweeperdb MODIFY FILE ( NAME = logical_filename, FILENAME = 'Path_to_the_lansweeperdb_file.mdf' );
ALTER DATABASE lansweeperdb MODIFY FILE ( NAME = logical_logfilename, FILENAME = 'Path_to_the_lansweeperdb_logfile.LDF' );
GO
ALTER DATABASE lansweeperdb SET ONLINE;
ALTER DATABASE lansweeperdb SET MULTI_USER;
GO
--Verify the new location.
SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N'lansweeperdb');


Important: the db files on the target drive must have the same security as on the source drive.
cansaydam
Engaged Sweeper
Thanks, but I want to move only the location of database on the same computer to the another drive.
If I stop the lansweeper service and move the database files to the another drive, Where can I configure the location of it?

Regards

Jon
Hemoco
Lansweeper Alumni
Move of SQL server is supported, move of SQL compact is not.

http://www.lansweeper.com/kb/17/move-lansweeper-to-different-server.html
cansaydam
Engaged Sweeper
Is it available to move the database after it is installed and started to work?

Thanks in advance

Regards

Jon
cansaydam
Engaged Sweeper
Hi, Thanks for your reply. I want to move lansweeperdb.. When I check the Configuration->Database script->Database information , It shows the size of the lansweeperdb. It is almost 3 GB.

Thanks

Jon
Hemoco
Lansweeper Alumni
Could you clarify your question. Are you asking about moving an SQL Compact database or an SQL Server database?