How to remove SQL Server 2017 after in-place upgrade to 2022 on Azure SQL VM?

Nikunj Patel 20 Reputation points
2025-09-17T18:58:10.8633333+00:00

Hi community members,

I’ve completed an in-place upgrade of SQL Server from 2017 to 2022 on an Azure SQL VM using this Microsoft guide: Change SQL Server version on Azure VM.

The upgrade went fine, and the VM is re-registered with the SQL IaaS Agent Extension. However, I now see both SQL Server 2017 and SQL Server 2022 showing up on the VM.

What is the best practice for removing SQL Server 2017 after an in-place upgrade on an Azure SQL VM? Is it safe to uninstall 2017 directly, or is there a recommended cleanup process to avoid issues with the 2022 instance?

Thanks for your help.

SQL Server on Azure Virtual Machines
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 63,720 Reputation points MVP Volunteer Moderator
    2025-09-17T19:12:20.42+00:00

    An in-place upgrade replaces the binaries of the existing instance (e.g., MSSQLSERVER), but it doesn't always clean up all the old program files, registry entries, or components (like shared features, client tools, or setup files). That's why "SQL Server 2017" can still appear in Programs and Features (or in Azure portal inventory), even though your engine is now SQL Server 2022.

    1. Confirm the instance version
      • Connect with SSMS and run:
             SELECT @@VERSION;
        
        This should report SQL Server 2022 for your upgraded instance.
    2. Do not uninstall the Database Engine for 2017 separately. The in-place upgrade converted your 2017 binaries into 2022 — uninstalling "SQL Server 2017" in Programs and Features could break the upgraded instance because it's the same MSSQLSERVER instance underneath.
    3. Remove only redundant shared components if desired.
      • Old client tools, backward-compatibility features, or SDKs from 2017 can be removed if you no longer need them.
      • Look for "Microsoft SQL Server 2017 (Shared Features)" or similar entries — those are safe to uninstall.

    SQL IaaS Agent Extension should correctly report 2022 as the active version. If you see 2017 still being surfaced, that's often just leftover metadata and not a functional engine.

    For Microsoft's recommendation regarding this scenario, refer to https://free.blessedness.top/sql/database-engine/install-windows/upgrade-sql-server


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.