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


    cugcblogs

    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.

    https://docs.citrix.com/en-us/tech-zone/build/tech-papers/citrix-communication-ports.html#workspace-environment-management

    SourceDestinationTypePortDetails
    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
    image.png.77f40a2a449e2557b11c2cc4d1f16608.png

    ======================

    Step 1

    ======================

    1. Snapshot WEM Servers
    2. Backup from old SQL server
    image-1.png.f46a7aa41aab2a03fbb539ec05d1b037.png
    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.
    image-2.png.58943ec210302e1120b804b65286e7bf.pngimage-3.png.43b448c8d41603d13bf113a123061d25.png

    ======================

    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
    image-4.png.26200110abe564891eee7441ea97a58e.png

    ======================

    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.
    image-5.png.e711d8f3ee3dd9835592ad9f503b4778.pngimage-6.png.73fbaa4fe154b16cf83fdb4920d54230.pngimage-7.png.a294776683b1b7ca53df9806953506e0.pngimage-8.png.6d71b6ec2c73e6bb22066b5d5e9d24bb.pngimage-9.png.3a549ad0d6ecfe52d871e2ecdae9b896.png
    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.
    image-10.png.3a25147802a19aef30dcdde8a2623c95.png
    1. In the Database Settings. Set the Name in the Database Server and Instance to the New Name.
    image-11.png.6d3e96117e0dbeeaa80a9bcdb1239a4e.pngimage-12.png.6232fd7f1b50dec3faae2f8802ad0752.png
    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
    image-13.png.4b3e44feaf9228d19d168c02a45a6850.pngimage-14.png.84a640b250cfff8605779720d4e68577.png

    ===============================

    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.
    image-16.png.c1dfb8cca8929f17c29c18cf58e891cb.png

    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:

    image-15.png.66745ae146af79f6f3caa267dfc813fd.png


    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...