In-place Change of SQL Server Version on Azure VM
Applies to: SQL Server on Azure VM
This article describes how to change the version of Microsoft SQL Server on a Windows virtual machine (VM) in Microsoft Azure.
To do an in-place upgrade of SQL Server, the following conditions apply:
- The setup media of the desired version of SQL Server is required. Customers who have Software Assurance can obtain their installation media from the Volume Licensing Center. Customers who don't have Software Assurance can use the setup media from an Azure Marketplace SQL Server VM image that has a later version of SQL Server (typically located in C:\SQLServerFull).
- Version upgrades should follow the support upgrade paths.
Planning for version change
We recommend that you review the following items before you do the version change:
Check what's new in the version that you are planning to upgrade to:
We recommend that you check the compatibility certification for the version that you are going to change to so that you can use the database compatibility modes to minimize the effect of the upgrade.
You can review to the following articles to help ensure a successful outcome:
Upgrade SQL Version
Upgrading the version of SQL Server will restart the service for SQL Server in addition to any associated services, such as Analysis Services and R Services.
To upgrade the version of SQL Server, obtain the SQL Server setup media for the later version that would support the upgrade path of SQL Server, and do the following steps:
Back up the databases, including system (except tempdb) and user databases, before you start the process. You can also create an application-consistent VM-level backup by using Azure Backup Services.
Start Setup.exe from the SQL Server installation media.
The Installation Wizard starts the SQL Server Installation Center. To upgrade an existing instance of SQL Server, select Installation on the navigation pane, and then select Upgrade from an earlier version of SQL Server.
On the Product Key page, select an option to indicate whether you are upgrading to a free edition of SQL Server or you have a PID key for a production version of the product. For more information, see Editions and supported features of SQL Server 2019 (15.x) and Supported version and edition Upgrades (SQL Server 2016).
Select Next until you reach the Ready to upgrade page, and then select Upgrade. The setup window might stop responding for several minutes while the change is taking effect. A Complete page will confirm that your upgrade is completed. For a step-by-step procedure to upgrade, see the complete procedure.
If you have changed the SQL Server edition in addition to changing the version, also update the edition, and refer to the Verify Version and Edition in Portal section to change the SQL VM instance.
Downgrade the version of SQL Server
To downgrade the version of SQL Server, you have to completely uninstall SQL Server, and reinstall it again by using the desired version. This is similar to a fresh installation of SQL Server because you will not be able to restore the earlier database from a later version to the newly installed earlier version. The databases will have to be re-created from scratch. If you also changed the edition of SQL Server during the upgrade, change the Edition property of the SQL Server VM in the Azure portal to the new edition value. This updates the metadata and billing that is associated with this VM.
An in-place downgrade of SQL Server is not supported.
You can downgrade the version of SQL Server by following these steps:
Make sure that you are not using any feature that is available in the later version only.
Back up all databases, including system (except tempdb) and user databases.
Export all the necessary server-level objects (such as server triggers, roles, logins, linked servers, jobs, credentials, and certificates).
If you do not have scripts to re-create your user databases on the earlier version, you must script out all objects and export all data by using BCP.exe, SSIS, or DACPAC.
Make sure that you select the correct options when you script such items as the target version, dependent objects, and advanced options.
Completely uninstall SQL Server and all associated services.
Restart the VM.
Install SQL Server by using the media for the desired version of the program.
Install the latest service packs and cumulative updates.
Import all the necessary server-level objects (that were exported in Step 3).
Re-create all the necessary user databases from scratch (by using created scripts or the files from Step 4).
Verify the version and edition in the portal
After you change the version of SQL Server, register your SQL Server VM with the SQL IaaS Agent extension again so that you can use the Azure portal to view the version of SQL Server. The listed version number should now reflect the newly upgraded version and edition of your SQL Server installation.
If you have already registered with the SQL IaaS Agent extension, unregister from the RP and then Register the SQL VM resource again so that it detects the correct version and edition of SQL Server that is installed on the VM. This updates the metadata and billing information that is associated with this VM.
- We recommend that you initiate backups/update statistics/rebuild indexes/check consistency after the upgrade is finished. You can also check the individual database compatibility levels to make sure that they reflect your desired level.
- After SQL Server is updated on the VM, make sure that the Edition property of SQL Server in the Azure portal matches the installed edition number for billing.
- The ability to change the edition is a feature of the SQL IaaS Agent extension. Deploying an Azure Marketplace image through the Azure portal automatically registers a SQL Server VM with the extension. However, customers who are self-installing SQL Server will have to manually register their SQL Server VM.
- If you drop your SQL Server VM resource, the hard-coded edition setting of the image is restored.
For more information, see the following articles:
- Overview of SQL Server on a Windows VM
- FAQ for SQL Server on a Windows VM
- Pricing guidance for SQL Server on a Windows VM