If you have installed an evaluation (trial) Microsoft SQL Server edition, note that this MSSQL instance will work only for 180 days. Then you must either stop using this instance or upgrade your SQL Server Evaluation edition to a Standard/Enterprise. It often happens that after testing a trial SQL Server version you decide to use it in a production environment, but you don’t want to completely reinstall MSSQL.
You can find out the date when your SQL Server Evaluation expires by using:
- Microsoft SQL Server Management Studio (Help -> About)
- An SQL query:
SELECT create_date AS 'SQL Server Install Date', DATEADD(DD, 180, create_date) AS 'SQL Server Expiration Date'
WHERE name = 'NT AUTHORITY\SYSTEM'
- a Start Time value in the SQL Server installation log (C:\Program Files\Microsoft SQL Server\XXX\Setup Bootstrap\LOG\
After the trial period expires, SQL Server doesn’t stop the databases automatically. However, if you restart the SQL Server service or reboot the host, your SQL Server service (mssql) won’t start and the following error message will appear:
Windows could not start the SQL Server (MSSQLSERVER) on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 17051.
At the same time, you will see these errors in the Event Viewer -> Application:
EventID: 17051, Source: MSSQLSERVER SQL Server evaluation period has been expired.
Errors like these appear in
2021-11-29 10:19:12.22 Server Error: 17051, Severity: 16, State: 1. 2021-11-29 10:19:12.22 Server SQL Server evaluation period has expired.
When running SQL Server Management Studio (SSMS) or SQL Profiler, you can also see this error:
Evaluation period has expired. For information on how to upgrade your evaluation software please go to https://www.microsoft.com/sql/howtobuy
When connecting to an expired SQL Server instance, you will see this message:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server).
Upgrading SQL Server from Evaluation to Standard/Enterprise
In order to upgrade your MSSQL instance from an Evaluation edition to a commercial one, you need a product key. Run the SQL Server Installation wizard from a distro image or through the SQL Server Installation Center (Microsoft SQL Server 2019 -> Configuration Tools):
- Click Maintenance section and select Edition Upgrade;
- In the next step, enter your product key;
- Confirm EULA;
- The wizard will detect an installed SQL Server Evaluation edition on your computer;
- Click Upgrade and wait till your MSSQL version is upgraded;
- After that, start MSSQL services manually or restart your host.
- SQL Server 2019 (15.x) Enterprise (Server+CAL or Core License)
- SQL Server 2019 (15.x) Standard
- SQL Server 2019 (15.x) Developer
- SQL Server 2019 (15.x) Web
Edition upgrade is not supported for Windows Failover Cluster scenarios, including when using Always On Availability Groups.
If you see the Engine_SqlEngineHealthCheck error during the SQL Server edition upgrade, do it from the command prompt (paths may be different):
Cd "C:\Program Files\Microsoft SQL Server\xx\Setup Bootstrap\SQLServer2019\"
setup.exe /q /ACTION=editionupgrade /InstanceName=MSSQLSERVER /PID=<ProductKey> /SkipRules=Engine_SqlEngineHealthCheck
<ProductKey> is your 25-character product key.
If you don’t have your own product key and you are using your MSSQL instance for development and testing only, you can upgrade the Evaluation edition to a free Developer Edition. To do it, download an installation image of SQL Server Developer Edition (https://www.microsoft.com/en-us/sql-server/sql-server-downloads). Run the edition upgrade as described above and select Free Developer as a target edition.
This guide can be used to upgrade an edition from Evaluation to a higher one is applicable for all supported Microsoft SQL Server versions (2019, 2017, 2016, 2014, and 2012).
How to Upgrade SQL Server Evaluation to Volume License?
If you want to upgrade your SQL Server edition using Microsoft Volume Licensing, you will be surprised that there are no keys for MS SQL Server in the Microsoft Volume Licensing Service Center (MS VLSC).
No product key is required.
The matter is that the product key is integrated into the distribution directly. The most interesting thing is that the VLSC support recommends uninstalling SQL Server and installing it again using an ISO file with the SQL distribution from the VLSC.
Fortunately, you can get the valid product key directly from the distribution:
- Download an ISO file with the SQL distribution from your account in Microsoft Volume Licensing Service Center (https://www.microsoft.com/Licensing/servicecenter/);
- Mount the downloaded ISO file on any other server (without an installed SQL Server instance);Note. The .NET Framework 3.5 must be installed on your server.
Setup.exefrom the SQL Server installation image;
- Select Installation -> New installation or add features to an existing installation;
- Then follow the wizard instructions and you will see the volume license key for your MS SQL Server;
- Write the key down and abort the SQL Server installation;
- Upgrade the SQL Server following the guide in the beginning of this article (using the key you have written down).
Extending Microsoft SQL Server Evaluation Period
Microsoft doesn’t support extending the trial period for MS SQL Server over 180 days. However, if you want your expired SQL Server to work a little bit more in a test environment, you can just edit the date on your server (by setting a date to 180 days ago) and restart SQL Server services (MSSQL Server, SQL Server Agent, SQL Server Browser, SQL Server Reporting Service).
After restarting the services, you can set the correct date and time on your server. SQL Server services will work till the next host or service restart.