Jump to content
Welcome to our new Citrix community!
  • Citrix WEM Database Migration


    raydavis22rnd.jpg 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 serviceAgent hostTCP49752“Agent port”. Listening port on the agent host which receives instructions from the infrastructure service.
    Administration consoleInfrastructure serviceTCP8284“Administration port”. Port on which the administration console connects to the infrastructure service.
    AgentInfrastructure serviceTCP8286“Agent service port”. Port on which the agent connects to the infrastructure server.
    Agent cache synchronization processInfrastructure serviceTCP8285“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.
      TCP8288“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 serviceInfrastructure serviceTCP8287“WEM monitoring port”. Listening port on the infrastructure server used by the monitoring service. (Not yet implemented.)
    Infrastructure serviceMicrosoft SQL ServerTCP1433To connect to WEM Database
     Citrix License ServerTCP27000“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.
      TCP7279The 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.


    1. Open the WEM Infrastructure Service Configuration Utility from the Start menu.
    2. On the Advanced Settings tab, select Enable debug mode.
    3. Click Save Configuration and click Yes to start the service to apply the change.
    4. Close the WEM Infrastructure Service Configuration Utility window.
    5. By default, this log file is located in %PROGRAMFILES(X86)%\ Norskale\Norskale Infrastructure Services
    6. Citrix WEM Infrastructure Service Debug.log is the name of the log


    Step 1


    1. Snapshot WEM Servers
    2. Backup from old SQL server
    1. 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.
    2. Click OK to start the backup.


    Step 2


    1. Copy the account over with command.
    2. You need to import the DBA tools (Note: other 3rd party SQL tools can do this for you.)
    3. In this instance, I did it with dbatools
    4. If you have tools that do this then it may not be needed
    5. No internet access https://github.com/dataplat/dbatools/discussions/7984
    6.  if you have internet access move to c)
    7. Internet access "Install-Module dbatools"
    8. Check both ways : Get-Module dabtools -ListAvailable
    9. You need to copy the accounts over but using this: Copy-DbaLogin -source SQLServer -Destination SQLServer


    Step 3


    Restore to new SQL server.

    1. 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.
    2. We need to remote into the new SQL Server and Restore the Databases.
    3. In this case, it’s LABSQL02. Do this for each Database independently.
    1. Verify mappings and VeumUser accounts


    Step 4


    1. Open WEM Infrastructure Service Configuration on the WEM Infrastructure servers.
    2. It will show the Old Database here.
    1. In the Database Settings. Set the Name in the Database Server and Instance to the New Name.
    1. Don't set anything in "Database Failover server and instance.”
    2. Put the Database name in "Database Name.”
    3. Save settings.
    4. Open Workspace Service Configuration, ensure all settings match, then click save.
    5. WEM will now open and connect to the Database along with the configuration sets.
    6. Check Event Logs for Errors


    Step 5 Verify Logs for successful migration


    1. The log file is located in %PROGRAMFILES(X86)%\ Norskale\Norskale Infrastructure Services
    2. Citrix WEM Infrastructure Service Debug.log is the name of the log.

    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:


    User Feedback

    Recommended Comments

    There are no comments to display.

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

  • Create New...