With Windows Server 2012 and 2012 R2 reaching their end of life at the end of 2023, organizations must consider migrating their Remote Desktop Services (RDS) deployments from Windows Server 2012 to 2022. When doing so, you have to follow a distinct order to upgrade the RDS roles. By migrating the connection broker, you keep the configuration of the deployment.
Avatar

There are a few things to do in preparation for an upgrade from 2012 to Windows Server 2022 to ensure that data is backed up and the environment is prepared.

  • Back up your RDS infrastructure using Windows Server Backup or a third-party backup tool
  • Review the order of operations: 1) RD Connection Broker servers, 2) RD License Servers, 3) RD Session Host servers, 4) RD Virtualization Host servers, and then 5) RD Web Access servers
  • Test the process: Before you upgrade your environment, it is essential to test the upgrade in a lab environment.

Steps for migrating the RDS Connection Broker

Migrating an RDS deployment from Windows Server 2012 R2 to Windows Server 2022 involves Windows in-place upgrades or installing a new server and migrating the configuration. The Connection Broker holds the database with the settings for the RDS deployment and collections. It must be the first role you update. An RDCB running on a newer version of Windows Server can coexist with older RD session hosts.

The only components with direct migration are the RD Web, the RD Gateway, and the licensing server.

In-place upgrade of RDS servers

You can upgrade the RDS servers to Windows Server 2022. Additional Windows Server upgrade guidance is available here.

According to Microsoft's documentation, you can't have the highly available connection brokers in an active/active configuration with mixed versions of Windows Server. Remove all but one of the RDCB servers from the setup and perform an in-place upgrade. Then, upgrade the remaining RDCB servers offline and add them to the cluster again.

Below is an example of the upgrade path for Windows Server 2012 and R2 to Windows Server 2022. From 2012 to 2022, there will be several steps, including 2016, 2019, and 2022.

Supported upgrade paths for Windows Server

Supported upgrade paths for Windows Server

Migrate the configuration and data to a new server

An in-place upgrade is not applicable in many cases and has several downsides. It might cause significant downtime and might even fail; hence, the server wouldn't be available until a successful rollback is performed. In general, in-place upgrades of complex systems often lead to stability and performance issues.

Therefore, you may want to install a new Windows Server 2022 server and migrate your RDS settings and collections from your Windows Server 2012 server. There is a module in the PowerShell Gallery by Micha Wets called ExportImportRdsDeployment. You can use it to export your RDS settings from your Windows Server 2012 RDCB and import them to Windows Server 2022.

Note that the module only supports session-based desktop deployments, not virtual machine-based deployment (using a virtualization host). Furthermore, it will only migrate RD Gateway, RD Web Access, and RD Session Host. RD Connection Broker and RD Licensing Server should already be installed on the new Connection Broker.

First, we install the module and export the collections from Windows Server 2012 RDCB with the following cmdlets:

Install-Module ExportImportRdsDeployment -Force
Export-RDCollectionsFromConnectionBroker -ConnectionBroker local -XMLFile <file location>
Export collections from the Windows Server 2012 RDS server

Export collections from the Windows Server 2012 RDS server

Next, we run the command to export the deployment configuration:

Export-RDDeploymentFromConnectionBroker -ConnectionBroker localhost -XMLFile <file location> -Verbose
Exporting the RDS deployment settings from Windows Server 2012

Exporting the RDS deployment settings from Windows Server 2012

Once settings are exported from Windows Server 2012, we can import them into Windows Server 2022. Install the RDS roles on your Windows Server 2022. Copy the XML files generated from the export on your 2012 server to your 2022 server.

There, you can use the following command:

Import-RDDeploymentToConnectionBroker -ConnectionBroker localhost -XmlFile <exported XML file>

Below, you will see several parameters that need to be populated. Here, we pass in empty placeholders for certificate parameters since they were not exported from 2012.

Importing the Windows Server 2012 RDS configuration to Windows Server 2022

Importing the Windows Server 2012 RDS configuration to Windows Server 2022

After the RDS deployment configuration is imported, we import the collection information using the following:

Import-RDCollectionsToConnectionBroker -ConnectionBroker localhost -XmlFile <Exported Collection XML> -Verbose
Importing the RDS collection export to Windows Server 2022

Importing the RDS collection export to Windows Server 2022

Below, you can see the "TestCollection" successfully imported into the Windows Server 2022 server.

The deployment configuration and collections import is successful in Windows Server 2022 RDS

The deployment configuration and collections import is successful in Windows Server 2022 RDS

You will still need to migrate user profiles and data. You can do this in many ways, including copying the data to a network share, using a profile migration tool, or using the User State Migration Tool (USMT).

Conclusion

Migrating an RDS deployment from Windows Server 2012 to Windows Server 2022 requires careful planning and execution. The configuration database for the deployment is located on the RDCB. Therefore, migrating the Connection Broker role is crucial for an RDS upgrade. Micha Wets' PowerShell module makes this task easy. However, you have to set up the new RDCB and license server yourself before you copy the RDS configuration to the new server.

Subscribe to 4sysops newsletter!

An RDCB on a new version of Windows Server is compatible with down-level versions of RD session hosts. RD Web Access and RD Gateway can be upgraded at any time.

avataravatar
3 Comments
  1. Avatar
    Nicholas Kulkarni 7 months ago

    Thanks so much for this article I am in the middle of this project. Really needed a concise guide and this is very helpful.

  2. Avatar
    Andreas Jensen 3 months ago

    after following this guide i can’t open the Server manager, the windows internal database cant be opened. any hints

  3. Avatar
    Yaron 2 months ago

    Hi Lee,
    How can i migrate from windows 2016 (in place upgrade is not possible) holding all roles (RDCB, RD Virtualisazion (Personal Managed collection), RD Web Access, RD Licensing) be exported to the new Windows 2022
    server ?
    Many Thanks for your help

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account