Wednesday, March 1, 2017

Downgrade from SQL Server Enterprise Edition to Standard Edition

Downgrade from SQL Server Enterprise Edition to Standard Edition


Problem
I have a SQL Server that was installed as Enterprise Edition. I don't need the Enterprise features and I don't want to pay for the licensing. What is the best way to downgrade to Standard Edition?
Solution
I've came across a lot of SQL Server's in my career that were installed using the Enterprise Edition and never utilized the Enterprise features. Downgrading to a lower edition cannot be done in place. This tip will describe the steps needed to downgrade.

Create Database Backups

As always, before doing anything drastic (or non-drastic), BACKUP all the databases (system and user)! Also, if you have a development environment, please test on it first.

Check for Enterprise features

After backing up the databases run the following query on each database:
SELECT * FROM sys.dm_db_persisted_sku_features
This DMV will tell you whether or not the database is utilizing any of the Enterprise features. You can find more information regarding this DMV from this tip.

Check Version and Build Number

Because you never know when an install may fail, check the version and build number of the current SQL Server. After the downgrade, you will need to bring the new SQL Server back to the patch level. You can view this information by executing the following command:
SELECT @@VERSION


Check Version and Build Number
Save the results to a text editor.

Decision...

There are two different directions we can go from here.
  1. We can do the traditional uninstall Enterprise, install Standard, patch, restore databases
  2. Or we can do what I call "The Jonathan Kehayias" approach. (I saw this method awhile back from a forum post by Jonathan):

Copy System Databases

Shutdown the SQL Server service and copy the master, model and msdb database files (.mdf and .ldf) to another location. We will need these later:
hutdown the SQL Server service and copy the master, model and msdb database files


Copy System Databases

Uninstall SQL Server

Uninstall SQL Server from Control Panel:
Uninstall SQL Server from Control Panel
You only need to uninstall the Instance (includes SSIS, SSAS, SSRS, SSDT). There is no need to uninstall the Shared Components (SSMS, Client Tools, and Connectivity).
You only need to uninstall the Instance (includes SSIS, SSAS, SSRS, SSDT)


There is no need to uninstall the Shared Components (SSMS, Client Tools, and Connectivity)


Reboot

Reboot

Reboot the server. After rebooting, browse to the location of the data files and you will notice that the user databases weren't removed with the uninstall, but the system databases were. This is why we copied them in the step above:
After rebooting, browse to the location of the data files and you will notice that the user databases weren't removed with the uninstall, but the system databases were.

Install New SQL Server Edition

Enterprise Edition should be completely removed from the system now. Insert/Mount the media for SQL Server Standard and install. The install should be pretty straight forward. To make things easier in the end, make sure the name of the instance remains the same and the Data Directories point to the correct location.
Once SQL Server is finished installing, open SQL Management Studio and connect to the newly installed instance.
If you expand Databases, Security/Logins, SQL Server Agent/Jobs, etc. you will see it looks like a fresh copy of SQL Server.
If you expand Databases, Security/Logins, SQL Server Agent/Jobs, etc. you will see it looks like a fresh copy of SQL Server
Also, if you run the following command you will see that the version has changed to Standard Edition:
SELECT @@VERSION


Also, if you run the following command you will see that the version has changed to Standard Edition

Install SQL Server Patches

In this example, you will also notice that the build number has changed from 11.0.3000.0 to 11.0.2100.60 so I will need to install the correct patches to bring this server back to 11.0.3000.0.
(11.0.3000.0 is SQL Server 2012 SP1)
Download the correct patches and install on the server before doing anything else.
Once the patches are installed check the server to make sure it's at the same build number as it was before.

Copy System Databases

Shutdown the SQL Server service and copy the master, model and msdb database files (.mdf and .ldf) from the location you saved them in to the new location for the new install.
Copy System Databases


Shutdown the SQL Server service and copy the master, model and msdb database files

Start SQL Server

After copying the system files to the new location you can start SQL Server again:
After copying the system files to the new location you can start SQL Server again
Once SQL Server comes back online, you should see all the databases, logins, jobs, etc. back to normal:
Once SQL Server comes back online, you should see all the databases, logins, jobs, etc. back to normal
Next Steps
  • The example I showed was downgrading Enterprise to Standard, however, this should work in any downgrade scenario
  • Starting in SQL Server 2008, Microsoft added an "Edition Upgrade" wizard to help with upgrading editions. You can view more information from this tip.

No comments:

Post a Comment

  How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...