Hello readers. Recently I was in the process of migrating from an old Citrix XenDesktop 1811 to 1912. Both environments depend on FSLogix for profile management. The new environment is created and ready to welcome users. But part of the challenge is moving the user’s data from the old environment to the new one.

This post will explain the used method for FSLogix migration from one an old FSLogix container to a new virtual desktop environment.

I want to say that this was the most suited way for my environment and worked perfectly for me. It offers a minimum interaction between the users and Helpdesk agents. Maybe there is a better way to do this. I will be so happy to learn about it. Let me know in the comment below.

Prerequisites

  • A Share Folder
  • Read Permission on the old FSLogix user profile container.
  • Admin on the VDI client machine (used to restore the user’s data to their active session)

The Current Environment

The current (old) environment runs XenDesktop version 1811 (End-of-Life) with FSLogix as a profile container. The FSLogix containers are stored in a Windows Failover Cluster. The total number of users using this environment is about 400 users.

Looking to learn more about FSLogix, read more about it on Microsoft.com

One month before reaching the user’s shifting phase, a circular is sent to all users, informing them of the plan and encourage them to move all the data to their user’s map drive. So when the user migrated to the new environment, they can find their data easily. But most of them did not do anything and did not copy their data (Desktop, Documents…etc.).

Users Complaint, Where are my data ?!

Later on, we started onboarding users to the new environment, and guess what… The Helpdesk starts to get calls from multiple users asking about their old data. The funny thing is some users move their Desktop files only, not the files in My Documents. Others requests to get their Google bookmarks and Internet Explorer Favorites.

So in general now I have the following:

  • Users successfully copy their data, store them in the Map Drive, and restore them to their new VDI.
  • Other users partially copied their data, such as Desktop, but did not copy Documents or other folders.
  • Few users missed Google Bookmark or Internet Explorer Favorites.
  • Users who did not do anything.

Moving FSLogix data to the new Environment.

One big challenge is not overloading the Helpdesk with calls and ensuring that they can copy the user data with very minimum steps. Also, I don’t want to grant them access to the VHDX. So I created a PowerShell script that does the following:

  • A PowerShell script runs on a server and has access to the VHDX and the VDI environment.
  • The Script will mount the user VHDX and send the user files Desktop, Documents…etc. Direct to the user active VDI session. This will ensure that the user’s new FSLogix container is created along with a new profile.
  • As this process runs on-demand and the Helpdesk should specify the users, the Helpdesk needs a way to interact with the PowerShell script. So I created a simple PowerShell GUI application name it (Helpdesk FSLogix).
  • The Helpdesk FSLogix writes a configuration file with the targetted user’s details and missing files to a shared folder, Pickup Folder.
  • The main PowerShell script will read the content of the Pickup folder and process it accordingly.
PowerShell Script workflow
PowerShell workflow example
Helpdesk Tool

Let’s create the tools.

The PowerShell Script logic will follow these steps

  • The PowerShell script that keeps monitoring the pickup directory, and once a configuration file is placed, it will do the following:
    • Connect to the old FSLogix container.
    • Mount the container as a mounting point in the same server the script is running.
    • Connect to Citrix Delivery Controller to find on which VM the user is active.
    • Copy the required data based on the paths provided in the configuration to the user’s active session.
  • The Helpdesk FSLogix tool creates a small configuration file and places it in a shared folder, “Pickup Directory.” The configuration file .dat contains information about what the user needs to restore. For example, Desktop, Documents, Chrome bookmark…etc. The configuration file contains three lines only.
    • CopyDataFrom=: is the folder name to copy such as Desktop, Documents…
    • CopyFiles=: is the file path to copy, for example, Documents\MyMusic.mp3, Appdata\Folder1\File1.
    • Agent=: the Helpdesk agent requested the submitted the move request. This is used to send an email notification for the agent once the process is completed/failed.
CopyDataFrom=Desktop,Documents,Pictures,Favorites
CopyFiles=AppData\Local\Google\Chrome\User Data\Default\Bookmarks,Documents\MyMusic.mp3
Agent=helpdesk1@domain.com

How does it work in action

Let’s assume a user named VDI1 who recently shifted to the new environment with no data. VDI1 contacted the helpdesk (Ticket or phone call) to get his data back.

Helpdesk Side “Helpdesk FSLogix”

VDI1 user requested his Desktop, Documents and Google Chrome bookmarks to be restored, plus one MP3 file named MySong.mp3 in the My Music folder, but not all the content of the My Music folder.

The helpdesk agent uses the Helpdesk FSLogix tool and selects the Desktop, Documents check box.

Folder selection

But what about Google Chrome bookmarks and the MySong.mp3 file. The helpdesk agent adds a File To Copy entry with the following path

  • Google Chrome: AppData\Local\Google\Chrome\User Data\Default\Bookmarks.
  • MySong.mp3: Documents\MyMusic.mp3

The path start from the users profile home folder

Adding files

What left is where to save the file, it should be the PowerShell Pickup Directory and click start.

The tool will write the configuration to the share folder with the selected and added configuration.

The entire operation took from the helpdesk less than one minute.

Server Side (PowerShell Script)

The PowerShell script on the server-side reads the .dat file written by the Helpdesk Agent tool and executes the workflow. The script accepts the following parameters:

  • PickUpFolder: This is the folder to pick up and read the configuration files .dat files. [String][Required]
  • VHDorVHDX: The type is the container. Is it VHD or VHDX? [String][required]
  • OldProfilePath: The location of the old FSLogix profile container. [string][required]
  • NewDeliveryCTRL: The new Delivery Controller which hosting the active VDI user’s session. [String][Required]
  • SMTPEnabled: This flag switch enable or disable sending notification via email to the Helpdesk agent, these notification are related to process progress. [Switch].
  • SMTPServer: The SMTP server to relay the messages to [String][Required if SMTPEnabled switch is presented]

Download The Script

You can download the PowerShell Script from my GitHub repo, also you can send a pull request if you want to update it or submit an issue to fix it.

What Else to read…

Rate this post