Come the day you want to install SQLServer 2019, when the first prerequisite is to have Windows 2019 installed. Not to worry, until you discover that your Azure VM doesn’t support upgrading its OS. The only option is really to create a new VM with the new OS and reinstall this machine. For a test setup, it’s probably manageable, but in #realworld this will quite quickly mean a new project, approvals, and months of pain.

The drawbacks are vast:

  • new server name:
    • update all possible connections in reports, user excel files, favorite links, ETL packages (even if you configured as good as possible with parameters)
    • parallel operations with double cost, data inconsistency
    • confusion at best
  • reinstall database engine, move data files, adjust backups
  • reinstall all third party components, call for updated licenses that are machine bound
  • reconfigure all security rights and access controls

Yet, still, there is a way to upgrade the OS on an Azure VM. Granted, I have not tried all combinations possible, but this procedure is based on the upgrade of Windows 2012 R2 to Windows 2019 Datacenter. It also worked coming from Windows 2016 Datacenter.

Upgrade procedure

Before we start, make sure to:

  • have a backup of your server (you can easily use Azure Backup for this)
  • have the installation media available as ISO file

The following steps will allow you to upgrade in-place. Execute them on the Azure VM you want to upgrade:

  • Mount the Windows 2019 ISO file
  • Open command prompt with Administrator privileges
  • Run : setup.exe /auto upgrade /DynamicUpdate enable /showoobe none
    Use /pkey XXXXX–XXXXX–XXXXX–XXXXX-XXXXX in case you have a installation media requiring a product key
  • Follow the setup wizard
    • note: Select the Image – Windows 2019 Datacenter (Desktop Experience)
    • note: You cannot upgrade to an Evaluation edition without losing all your data. So, always use the licensed install media

The server will restart, at which point your RDP session has stopped. Follow the progress of the installer through the Azure Boot diagnostics on the VM blade in the Azure portal.

Disclaimer

Microsoft’s official take on this is : https://support.microsoft.com/en-us/help/4014997/performing-an-in-place-system-upgrade-is-not-supported-on-windows-base

However, this approach took me about 1 hour to upgrade, without the drawback mentioned above.
Needless to say: always test this in a representative sandbox environment first, after which you can move to dev / test / prod doing a thorough testing between upgrades.