- What’s your ENow AppGov Score? Free Microsoft Entra ID app security assessment - Thu, Nov 30 2023
- Docker logs tail: Troubleshoot Docker containers with real-time logging - Wed, Sep 13 2023
- dsregcmd: Troubleshoot and manage Azure Active Directory (Microsoft Entra ID) joined devices - Thu, Aug 31 2023
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.
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>
Next, we run the command to export the deployment configuration:
Export-RDDeploymentFromConnectionBroker -ConnectionBroker localhost -XMLFile <file location> -Verbose
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.
After the RDS deployment configuration is imported, we import the collection information using the following:
Import-RDCollectionsToConnectionBroker -ConnectionBroker localhost -XmlFile <Exported Collection XML> -Verbose
Below, you can see the "TestCollection" successfully imported into the Windows Server 2022 server.
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).
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.