Overview
When performing the GFI LanGuard upgrade or installation, it is failing and the following error is encountered:
Failed to upgrade the database. Installation will not continue in order to avoid damaging the integrity of the GFI LanGuard Engine.
Solution
The error above can happen during an upgrade and, in rare cases, installation of the GFI LanGuard. It is related to the database missing the requirements needed to work properly.
When Using a Microsoft SQL Server Database Backend
For the Microsoft SQL backend, the most common root causes are:
- A connection to the SQL server is not established due to incorrect credentials entered for authenticating with the database.
- The account does not have the required permissions to connect to the SQL server or create a database.
- The SQL server is not started.
Follow the steps below to address the issue:
- Check the SQL server connection:
- Ensure that the SQL server is running and accessible using the SQL Server Management Studio to connect to that server.
- You may also create a connection to the SQL server using the Control Panel Administrative Tools Data Sources (ODBC) tool and perform the ODBC connectivity test.
- Verify whether the credentials provided via GFI LanGuard Database Maintenance when connecting to the SQL database are no longer valid, whether the user has been disabled or the password was changed:
- Open the GFI LanGuard application, go to Configuration Database Maintenance Options, and specify valid credentials for that SQL server.
Once the credentials are validated, close the application and re-initiate the upgrade. - SQL SA account credentials are most likely to have permissions. Enter SA account credentials and proceed with the upgrade process.
- Open the GFI LanGuard application, go to Configuration Database Maintenance Options, and specify valid credentials for that SQL server.
- Test whether you can actually create a new database on SQL Server using the credentials above.
- Check if the database file from the previously failed installation attempt exists. The installation log
%temp%\lanss_vXXX_lnssinstsql.csv
might show the following:
error ","CreateDbOnSQLServerEx - Failed to create the database 'LNSSScanResults12'. Result 7. Additional error details Cannot create file 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.SQLE2012ACMP\MSSQL\DATA\LNSSScanResults12.mdf' because it already exists. Change the file path or the file name, and retry the operation...
In such cases, detach the database from the SQL and delete or rename the MDF and LDF files previously created for the LNSSScanResults12 database.
If the LanGuard database was created using an older SQL server version and upgraded on a new SQL server, the process might fail. In this situation, verify if it's possible to revert to the previous SQL Server version and proceed with the upgrade process of LanGuard.
When Using a Microsoft Access Database Backend
For the Microsoft Access backend, the error usually means that the database is no longer available. I.e., the Microsoft Access database, which by default located on %ProgramDataFolder%\GFI\LanGuard XX\scanresults.mdb
was deleted or is stored in a location no longer available, e.g., remote SharePoint, removable drive, etc.
- Verify that the Access MDB file location specified in Configuration Database Maintenance Options is valid and that the file is accessible. Correct the path or restore the database from a backup.
Testing
Repeat the operation that was having issues and verify whether it completes successfully. If the issue remains, try installing the fresh SQL server, for example, the latest SQL Express, and repeat LanGuard installation using it as a backend. If the issue persists, contact GFI LanGuard Support.