Share via

Azure upgrade will not allow me to keep files

LSI 0 Reputation points
2026-03-28T18:44:20.48+00:00

I am using managed Disks. Power Shell confirmed.

I am using a standard VM from Azure - 2016. Hence the need to upgrade.

When asking license type in Power Shell it returns "Windows_Server"

I have tried upgrade from 2016 to 2022, 2025 and even 2019. No in place upgrade will allow saving data.

Current server is 2016 Data Center. Each attempt is for the newer Data Center Version.

Region is United States, English.

Any ideas?

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Manish Deshpande 5,420 Reputation points Microsoft External Staff Moderator
    2026-04-02T02:55:08.2333333+00:00

    Hi LSI,

    Thank you for your detailed post and for confirming key details like your use of managed disks, the Windows_Server license type (via PowerShell), the 2016 Datacenter edition, and your US English region. I understand you're attempting an in-place upgrade from Windows Server 2016 Datacenter to newer Datacenter versions (2019/2022/2025), but the setup process doesn't offer the "Keep files, settings, and apps" option—it's forcing a clean install instead.

    This is a common issue when using a standard downloaded ISO. For Azure VMs, Microsoft requires a specific Azure Marketplace upgrade media managed disk to enable data preservation. Generic ISOs (even official ones) often result in the keep-files option being unavailable due to license, edition, or media compatibility checks. Your current setup (managed disks + Windows_Server licensing) is fully compatible with the supported Azure in-place upgrade process.

    1. Supported: Direct in-place upgrade from Windows Server 2016 Datacenter is supported to 2019, 2022, or 2025 Datacenter.
    2. Why the option is missing: You're likely using non-Azure upgrade media. The official method creates a dedicated upgrade disk that automatically enables "Keep files, settings, and apps."
    3. Prerequisites: Enough free space on the OS disk (at least 32 GB recommended—expand if needed), snapshots for safety, and temporarily disable AV/firewalls.
    4. Your VM is ready: Managed disks confirmed, license type correct, and en-US locale matches the upgrade media.

    Steps to work on:

    1. Backup first Create a snapshot of your OS disk (and data disks) via the Azure portal. This lets you roll back instantly if needed.
    2. Create the Azure upgrade media managed disk (one-time step) Run a short PowerShell script in the Azure Cloud Shell or your local Az module. Example for Windows Server 2022 (repeat with the correct SKU for your target):
         $resourceGroup = "WindowsServerUpgrades"
         $location = "EastUS"  # Your region
         $diskName = "WinServer2022UpgradeDisk"
         $sku = "server2022Upgrade"  # Use server2019Upgrade, server2022Upgrade, or server2025Upgrade
         # ... (full script in the doc – it pulls the latest Marketplace image)
      
      This creates a managed disk from the official MicrosoftWindowsServer/WindowsServerUpgrade offer.
    3. Attach the upgrade disk to your running VM In the Azure portal → Your VM → Disks → Attach existing → Select the upgrade disk → Save.
    4. Perform the in-place upgrade (via RDP)
      • Connect to the VM.
      • Note the drive letter of the attached upgrade disk (usually E: or F:).
      • Open an elevated PowerShell prompt in that drive and run:
             .\setup.exe /auto upgrade /dynamicupdate disable /eula accept
        
      1. Post-upgrade
        • The VM will reboot several times.
        • Delete the upgrade media disk and any temporary snapshots once verified.
        • Re-enable your AV/firewall software.
        • Note: Azure Auto OS patching / Update Manager features may need re-configuration (the doc explains this).
      This process is fully supported by Microsoft for your scenario and has been used successfully on thousands of 2016 → 2022/2025 upgrades.

    Link : https://dori-uw-1.kuma-moon.com/en-us/azure/virtual-machines/windows-in-place-upgrade

    Thanks,
    Manish.


  2. Q&A Assist
    2026-03-28T18:44:39.8533333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The behavior is expected if the upgrade isn’t using the Azure-provided in-place upgrade media and path, or if the edition/activation doesn’t match the supported matrix.

    Key points and checks:

    1. Use Azure in-place upgrade media, not a generic ISO
    • For Azure VMs, the supported in-place upgrade path uses a special Managed Disk with Windows Server upgrade media created from Azure marketplace SKUs, not a manually attached ISO.
    • Create the upgrade media disk with the documented PowerShell script, using the correct sku value for the target version:
      • server2019Upgrade or server2022Upgrade or server2025Upgrade (for 2016 → 2019/2022/2025)
    • Attach that Managed Disk as a data disk to the VM, then run setup.exe from that disk inside the VM.
    • For Windows Server 2016/2019/2022/2025, the supported unattended upgrade command is:
        .\setup.exe /auto upgrade /dynamicupdate disable /eula accept
      
      This path is what preserves files, settings, and apps.
    1. Confirm the VM is volume-licensed (KMS client) and not evaluation
    • The Azure upgrade media requires the VM to be configured for Windows Server volume licensing (KMS client). This is the default for VMs created from generalized Azure images, but not always for imported/custom images.
    • If the VM was imported or its activation changed, configure the appropriate KMS client setup key and verify connectivity to Azure KMS as described in the activation troubleshooting steps. If the OS is evaluation or not using the correct KMS client key, the in-place upgrade with “keep” options may be blocked.
    1. Ensure edition and language match the supported matrix
    • Current OS: Windows Server 2016 Datacenter.
    • Target OS: Windows Server 2019/2022/2025 Datacenter.
    • The upgrade media disk is only created in en-US. The VM must effectively be en-US (system language/locale) to avoid compatibility issues.
    • If the VM was installed with a different language or edition, the setup UI will typically gray out “Keep personal files and apps”. Set system language/locale to en-US or use an OS that was originally installed with en-US as per guidance.
    1. Verify the supported in-place upgrade path
    • Use the Windows Server upgrade matrix to confirm that the exact source and target editions/versions are supported. For example, 2016 Datacenter → 2019/2022/2025 Datacenter is supported when using the correct media and licensing.
    • Azure Edition (e.g., “Datacenter Azure Edition”) has additional restrictions; in-place upgrade to 2025 Datacenter Azure Edition is not currently supported. If the VM is Azure Edition, the “keep files, settings, and apps” option will remain disabled for 2025 Azure Edition, and a clean deployment plus data migration is required.
    1. Confirm prerequisites on the VM
    • VM must use Managed Disks (already confirmed).
    • Ensure sufficient free space on the OS disk (at least 32 GB; guidance tools often check for ≥64 GB).
    • It is recommended to:
      • Create a snapshot of the OS and data disks before upgrading.
      • Temporarily disable antivirus/endpoint protection and non-essential agents that may interfere with setup.
    1. Recommended workflow
    • Run the Azure VM Windows OS Upgrade assessment script (Windows_OSUpgrade_Assessment_Validation) via Run Command to validate:
      • Supported upgrade paths for the current OS.
      • Disk space and memory.
      • Azure security features (Trusted Launch, Secure Boot, vTPM) that might affect upgrade.
    • Fix any issues the assessment reports, then:
      1. Create the upgrade media Managed Disk with the correct sku.
      2. Attach the disk to the VM.
      3. RDP into the VM, run setup.exe /auto upgrade /dynamicupdate disable /eula accept from the upgrade disk.
      4. Monitor progress via Boot Diagnostics screenshots in the Azure portal.

    If, after using the Azure upgrade media and confirming KMS volume licensing, edition, and language, the “keep files, settings, and apps” option is still unavailable, the remaining path is to deploy a new VM with the desired Windows Server version and migrate applications and data from the existing 2016 VM.


    References:

    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.