From Lansweeper 7.2 onward, SQL LocalDB is one of the available database server options for hosting your Lansweeper database. The LocalDB option is a custom variant of Microsoft SQL Server 2014 Express. It was introduced into Lansweeper as a replacement for the Microsoft SQL Compact database server. This knowledge base article provides further information on what LocalDB is, why it was introduced, how to manage it and how to convert from or to this database server.
What is LocalDB?
Lansweeper's LocalDB database server option is based on SQL Server 2014 Express. It has many of the same properties as SQL Server but also some notable differences. SQL Server 2014 was used as the basis for Lansweeper's LocalDB implementation as it is compatible with a wide range of operating systems and architectures. Below is a comparison between Lansweeper's different database server options.
|Database server||Packaged with Lansweeper||Max database size||Support for distributed Lansweeper components||Support for multiple scanning servers||Lansweeper support status|
|SQL Compact||✔||4GB||✘||✘||unsupported from March 2020 onward|
|SQL LocalDB||✔||10GB||✘||✘||supported database server|
(manual install required prior to installing Lansweeper)
|• 4GB (free Express editions lower than 2008 R2)|
• 10GB (free Express edition 2008 R2 or higher)
• unlimited (other editions)
|✔||✔||supported database server|
Why was this new database server option introduced?
LocalDB was introduced primarily as a replacement for the Microsoft SQL Compact database server option. Both database servers come packaged with the Lansweeper installer and are therefore easy to use. However, SQL Compact is being phased out by March 2020 for multiple reasons:
- SQL Compact has a number of limitations in functionality and reporting that make it incompatible with future Lansweeper features.
- SQL Compact has a 4GB database size limit.
- SQL Compact has limited performance in large networks.
- SQL Compact is fundamentally different from SQL Server, requiring separate development. As SQL LocalDB and SQL Server are basically the same database engine, dropping SQL Compact allows for Lansweeper development to be streamlined.
- SQL Compact has been deprecated by Microsoft and support will be discontinued.
How to manage your Lansweeper LocalDB database
Lansweeper tools like
ConfigEditor.exe can be used to perform certain operations on your LocalDB instance, as is the case for other database servers. For instance, you can change the LocalDB database password in the same way as you would change a SQL Server password. In addition, you can connect to your LocalDB instance using SQL Server Management Studio (SSMS), though only locally from your Lansweeper server. The following users have access to your LocalDB instance by default:
- The Windows user that performed the Lansweeper installation.
- The SQL user lansweeperuser, which is generated during the Lansweeper installation.
Your SQL instance name under LocalDB is
(localdb)\.\LSInstance. Using this server name and one of the two user accounts listed above, you can access your Lansweeper database using SSMS.
Which migration paths are available from and to LocalDB?
You can convert a SQL Compact database to LocalDB. You can also convert a LocalDB database to SQL Server, if you require the added SQL Server functionality. It's theoretically possible to migrate from SQL Server 2014 or older to LocalDB as well, though we would not recommend this, as a full SQL Server instance does offer more functionality.
Automatically migrating from Compact to LocalDB
If your Lansweeper installation is hosted in the Compact database server and you are updating to the latest Lansweeper version, your database is converted to LocalDB. This process is automatic and requires no user input, though the installer will indicate that this conversion is about to happen. Updating Lansweeper is the easiest and quickest way to migrate from SQL Compact to SQL LocalDB.
Manually migrating from Compact to LocalDB
There are cases where a manual migration from SQL Compact to LocalDB may be necessary, for instance when you don't have an active SQL Compact Lansweeper installation and only have a SQL Compact
lansweeperdb.sdf file. In this case, you can manually migrate your installation.
Migrating from LocalDB to SQL Server
There are various reasons why you might choose to move from LocalDB to SQL Server:
- You'd like to spread your Lansweeper components over multiple servers.
- You'd like to add more scanning servers to your Lansweeper installation.
- You'd like to increase your database capacity by using a paid SQL Server edition.
- You'd like to connect to your database remotely to perform remote queries.
If required, you can move from LocalDB to a full SQL Server 2014 or newer, any edition.