by Ray Davis, CTA & Jacksonville CUGC Leader
In the exciting journey of the past year, I embarked on a project that took me back in time to 1912 (not literally, of course). My mission? To perform a daring upgrade from CVAD 1912 LTSR to 2203 LTSR for one of our cherished customers. But that’s not all; this adventure included migrating databases to a new SQL Availability Group (AG).
To make things even more thrilling, I also had to revamp the Citrix WEM environment from 1912 to 2206 (at that time). Also, remember that there is no LTSR for Citrix WEM, only the current release. Citrix Workspace Environment Management is covered by the Current Releases (CR) lifecycle of Citrix Virtual Apps and Desktops. Current Releases will reach the End of Maintenance (EOM) 6 months after general availability (GA). Current Releases will reach End of Life (EOL) 18 months after GA. You can find more information about this here: Citrix Product Matrix – Citrix
I won’t delve into the nitty-gritty details of those upgrades because there are already countless blogs out there that can walk you through the process. I even have one on CUGC that you can use as a reference if needed. It goes over just about everything. It’s older, but it will guide you. How I Upgraded My Site From 7.15 Flat All the Way to 1912 | BLOGS (mycugc.org)
Instead, I’m here to guide you through a vital aspect of this escapade – the seamless migration of the WEM database from one SQL environment to another. It’s essential to keep in mind that there are numerous paths to achieving the same goal. In my humble opinion, there’s no definitive “right” or “wrong” way to accomplish this task. The world of database migration is versatile, and many different tools and methods can lead you to success.
For my particular journey, I chose a specific route to perform this migration. Your journey might take a different path, and that’s perfectly okay. What matters most is the end result of a successful database migration that meets your unique needs and preferences. So, let’s explore my chosen method and keep in mind that flexibility is the key to mastering this process.
Before we dive into the details of this blog, please note that what you’ll find here is essentially an outline based on my lab experience, serving as a roadmap for the steps I performed for my customer. I want to stress the importance of collaboration in the process. Working closely with your Database Administrator (DBA) and security team is a smart move to ensure everything is set up correctly and securely before you kick off this operation.
Often, one question I get asked is, Is there downtime? Technically speaking, no. The reason is the WEM agent Cache DB on the VDAs if the backend WEM environment is down. Now, this doesn’t mean performing this during the day. What I am saying is WEM has great resilience built into the product. However, it’s crucial to clarify that this doesn’t imply you should perform the migration during regular working hours. What I’m emphasizing is that WEM boasts impressive resilience built into its core functionality. So, while planning your migration, keep in mind that there won’t be downtime, but it’s still wise to choose a suitable window for this operation to ensure a smooth transition.
These are the required Ports that Citrix WEM needs, more importantly, the SQL side.
|Infrastructure service||Agent host||TCP||49752||“Agent port”. Listening port on the agent host which receives instructions from the infrastructure service.|
|Administration console||Infrastructure service||TCP||8284||“Administration port”. Port on which the administration console connects to the infrastructure service.|
|Agent||Infrastructure service||TCP||8286||“Agent service port”. Port on which the agent connects to the infrastructure server.|
|Agent cache synchronization process||Infrastructure service||TCP||8285||“Cache synchronization port”. Applicable to Workspace Environment Management 1909 and earlier; replaced by Cached data synchronization port in Workspace Environment Management 1912 and later. Port on which the agent cache synchronization process connects to the infrastructure service to synchronize the agent cache with the infrastructure server.|
|TCP||8288||“Cached data synchronization port”. Applicable to Workspace Environment Management 1912 and later; replaces Cache synchronization port of Workspace Environment Management 1909 and earlier. Port on which the agent cache synchronization process connects to the infrastructure service to synchronize the agent cache with the infrastructure server.|
|Monitoring service||Infrastructure service||TCP||8287||“WEM monitoring port”. Listening port on the infrastructure server used by the monitoring service. (Not yet implemented.)|
|Infrastructure service||Microsoft SQL Server||TCP||1433||To connect to WEM Database|
|Citrix License Server||TCP||27000||“Citrix License Server port”. The port on which the Citrix License Server is listening and to which the infrastructure service then connects to validate licensing.|
|TCP||7279||The port used by the dedicated Citrix component (daemon) in the Citrix License Server to validate licensing.|
If you’re anything like me, you’re a stickler for data and details. It’s only natural to want to see concrete evidence of how things are progressing, especially when undertaking a task as critical as database migration. While enabling logging isn’t mandatory, I highly recommend it. Why, you ask? Well, logging allows you to track and verify the entire process, ensuring that your database migration is reporting accurately.
Enabling logs also provides a sense of satisfaction when you can look back and say, “I did it, and I did it right!” So, let’s dive into this journey, take control of our data, and bask in the glory of a successful database migration with confidence.
Logging if needed.
- Open the WEM Infrastructure Service Configuration Utility from the Start menu.
- On the Advanced Settings tab, select Enable debug mode.
- Click Save Configuration and click Yes to start the service to apply the change.
- Close the WEM Infrastructure Service Configuration Utility window.
- By default, this log file is located in %PROGRAMFILES(X86)%\ Norskale\Norskale Infrastructure Services
- Citrix WEM Infrastructure Service Debug.log is the name of the log
- Snapshot WEM Servers
- Backup from old SQL server
- I left the defaults, and you would want to put it on a SAN/NAS like a Exagrid or data domain. Depending on your SQL backup requirements.
- Click OK to start the backup.
- Copy the account over with command.
- You need to import the DBA tools (Note: other 3rd party SQL tools can do this for you.)
- In this instance, I did it with dbatools
- If you have tools that do this then it may not be needed
- No internet access https://github.com/dataplat/dbatools/discussions/7984
- if you have internet access move to c)
- Internet access “Install-Module dbatools”
- Check both ways : Get-Module dabtools -ListAvailable
- You need to copy the accounts over but using this: Copy-DbaLogin -source SQLServer -Destination SQLServer
Restore to new SQL server.
- I will post some pictures from another blog post I did, where I restored a CVAD DB. The steps are the same. Ignore the Server name and DB names, though.
- We need to remote into the new SQL Server and Restore the Databases.
- In this case, it’s LABSQL02. Do this for each Database independently.
- Verify mappings and VeumUser accounts
- Open WEM Infrastructure Service Configuration on the WEM Infrastructure servers.
- It will show the Old Database here.
- In the Database Settings. Set the Name in the Database Server and Instance to the New Name.
- Don’t set anything in “Database Failover server and instance.”
- Put the Database name in “Database Name.”
- Save settings.
- Open Workspace Service Configuration, ensure all settings match, then click save.
- WEM will now open and connect to the Database along with the configuration sets.
- Check Event Logs for Errors
Step 5 Verify Logs for successful migration
- The log file is located in %PROGRAMFILES(X86)%\ Norskale\Norskale Infrastructure Services
- Citrix WEM Infrastructure Service Debug.log is the name of the log.
- Possible issues that I have seen in various environments. This always depends on each customer, depending on how things are structured inside their IT department.
- Move WEM SQL database to a new SQL instance with/without SysAdmin permissions (citrix.com)
One issue I encountered was that the WEM Agent Sync failed – Remote Provider. It took us some time to track this down. I only saw this when moving from a 1912 environment to a new build. ( Not Database migration-related)
- WEM Agent Sync failed – Remote Provider should have two scopes – WEM (Workspace Environment Management) – Discussions (citrix.com)
This tidbit of information here is not related to a WEM Database migration, but it’s more of a pre-check if you are upgrading Citrix WEM from an earlier build than 2006.
Upgrade a deployment | Workspace Environment Management 2308 (citrix.com)
- “Keep the following in mind when you plan to upgrade a WEM deployment earlier than 2006 to 2209 or later: To avoid database upgrade failures, upgrade to 2103 first and then to 2209 or later.”
With that, we wrap up our database migration journey. My hope is that the insights shared here will prove beneficial to someone within the vibrant Citrix community. The world of IT is all about sharing knowledge and experiences, and I’m thrilled to have had the opportunity to contribute to that ethos. So, as we conclude this chapter, remember that every step in your IT adventure is an opportunity to learn, grow, and support others. Here’s to successful migrations and the spirit of collaboration in the Citrix community!
More recent CUGC blogs: