[SOLVED] Extend Microsoft SQL Server Trial / Evaluation period


Restart SQL service after trial period - and continue using it

The problem usually occurs when you are running an evaluation instance of SQL Server and the evaluation time period has expired. I will show you a workaround, that enables you to continue using SQL even though it has expired.




Evaluation period has expired, SQL Management Studio dialog.



SQL Server Error 17051" when trying to start the SQL Server ...
When trying to start service after the period is expired, Error 17051




You have encountered, like i, the expiration of an SQL instance.You might not have an SQL license in hand at this moment, but have the need to use the SQL or SQL Management Studio. At least to extract your data for possible new installations.

Before i continue, i should mention, that SQL studio management now have become free. You don't actually need to worry about the expired license for SSMS. You can download it free of charge from Microsoft. Link is here: https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms



SQL services look at system time when determine if the license is still within evaluation period. So by changing the time back within the evaluation period, you will be able to start the service. When you are done, set the time back to normal. :)

In other words, you are extending SQL trial period.


Notes. Some of you have reported it not to work from SQL2016 and upwards. If you got it to work with SQL2016 or above. Please comment.
The following has been confirmed by users:
  •  SQL Server 2016 WS 2016
  •  SQL Server 2017 WS 2019
  •  SQL Server 2019 (note: adjust time to max 180 days)

How To:


Open services. You can see the service is not running and time is well beyond expiration in this example:







If the service is started, it will prompt for error 17051, which is expiration error.

Now if i turn system time back within the expiration date, i will be able to start the service without error, and start SQL management studio.

Remember to turn the time back to original date or your inserted dates will be wrong.


Heres a powershell script to automate the task. Edit as you feel.

The script gets current date, substract 360 (this can be changed to match the 180 evaluation period). Starts all services with SQL in the name, wait for them to start, then set the time back to normal.



$currentDate = Get-Date // Get current date

$pastTime = $currentDate.AddDays(-360) // Substract 1 year

set-date $pastTime // set current time to the past

Start-Service -Name "*sql*" -ErrorAction SilentlyContinue // Try to start the service

$areServicesStopped = $true // Check for service

while($areServicesStopped){ // Loop trying to get service up

$serviceStatus = get-service -Name "*sql*" | select status

if ($serviceStatus -notlike "Stopped") {

$areServicesStopped = $false

}

Start-Sleep -Seconds 1

}

$currentDate = $pastTime.AddDays(360) // Set date time to current date

set-date $currentDate

Notes:

This method works with SQL versions uptill publish date of this post (18/09/2017). If it has worked for you, feel free to comment which version worked for you (in case MS creates a fix).





Comments

  1. FYI - Not working for me running SQL 2016 on Windows 2012 R2.

    ReplyDelete
  2. thk, a lot. You are best. It really work. You save my night

    ReplyDelete
  3. FYI: If you indeed need to do an edition upgrade, please be aware that you cannot upgrade it AFTER the trial period has ended.
    So that's where this tip came in handy :)

    ReplyDelete
  4. Thank you for the tutorial and the script. It worked for me today with a WS 2016 and SQL Server 2016 evaluation version.
    The script helps start the instance before Active Directory changes the date in fews seconds.

    ReplyDelete
  5. The workaround works. Different Sql versions have different trial periods so you have to adjust the days accordingly. Ex. MS-SQL 2019 has 180 days so you have to adjust within that period. Thank You!

    ReplyDelete
  6. Worked on Windows Server 2019 Standard and SQL Server 2017 Evaluation version. I was then able to upgrade to SQL Server 2019 Standard and we are back in action.

    ReplyDelete

Post a Comment

Popular posts from this blog

[SOLVED] Veeam: Failed change tracking (CBT)