XenApp 4.5/5.0 to XenApp 6.5 – User Data Migration

Recently I have been involved in a Citrix XenApp migration project for a customer in Auckland. The customer had a XenApp 5.0 Citrix farm which was upgraded to XenApp 6.5 FP1. The user data which included the users’ home drive data and some of the piece that was present in their old profiles needed to be migrated to the new farm. There wasn’t any profile redirection configured with the old user profiles so some of the data needed to be extracted from their existing profiles and copied onto the new shares as well. I used the below script to copy the user data to the new share locations.

To migrate the user data for individual users, run the below script from an administrative command line as below. replace the username with the domain account name of the user you want to migrate the data for. i saved the script file as robocopy_user.cmd

You can name the script anything that you like but need to change the name of the script in StartCopy.cmd file that you will come across below.


set users=%1

REM – Copies all the home folder data to the new location. please amend the source and destination according to your needs
robocopy.exe F:\Users\%users% G:\XAHome\%users% /E /SEC /COPYALL /V /ETA /TEE

REM – Extracts and copies Desktop,Favorites and My Documents contents to the redirected folders in the new home drive folders

robocopy.exe I:\tsprofiles\%users%\Desktop G:\XAHome\%users%\Desktop /E /SEC /COPYALL /V /ETA /TEE

robocopy.exe I:\tsprofiles\%users%\Favorites G:\XAHome\%users%\Favorites /E /SEC /COPYALL /V /ETA /TEE

robocopy.exe “I:\tsprofiles\%users%\My Documents” “G:\XAHome\%users%\My Documents” /E /SEC /COPYALL /V /ETA /TEE

REM- Moves My Videos, My Pictures and My Music folders into the My Documents folder in the new share. this was done to tidy up the new home folder
robocopy.exe “G:\XAHome\%users%\My Videos” “G:\XAHome\%users%\My Documents\My Videos” /E /SEC /COPYALL /V /ETA /TEE /MOVE

robocopy.exe “G:\XAHome\%users%\My Music” “G:\XAHome\%users%\My Documents\My Music” /E /SEC /COPYALL /V /ETA /TEE /MOVE

robocopy.exe “G:\XAHome\%users%\My Pictures” “G:\XAHome\%users%\My Documents\My Pictures” /E /SEC /COPYALL /V /ETA /TEE /MOVE

attrib -s “G:\XAHome\%users%\My Shapes”
attrib -s “G:\XAHome\%users%\My Data Sources”

robocopy.exe “G:\XAHome\%users%\My Shapes” “G:\XAHome\%users%\My Documents\My Shapes” /E /SEC /COPYALL /V /ETA /TEE /MOVE
robocopy.exe “G:\XAHome\%users%\My Data Sources” “G:\XAHome\%users%\My Documents\My Data Sources” /E /SEC /COPYALL /V /ETA /TEE /MOVE

attrib +s “G:\XAHome\%users%\My Documents\My Shapes”
attrib +s “G:\XAHome\%users%\My Documents\My Data Sources”

You can even automate the same script to perform data migration in bulk. There are a extra pieces to get it to work.

There are 3 files; one being the script file as mentioned above ( no changes to that)

  • Robocopy_user.cmd
  • UsersToMigrate.txt
  • StaryCopy.cmd ( you can name it anything that you like)

The UsersToMigrate.txt file contains the Active Directory account names of all the users whom the data need to be migrated.


The StartCopy.cmd is the launcher script that calls the robocopy_user.cmd batch file

for /f %%A in (%1) do “robocopy_user.cmd” %%A


How do you run this thing?

Well, navigate to the location of the scripts and then run the scripts as below


Make sure that you make necessary changes according to your environment before executing the script.

Hope you find it useful and finally I have to thank my colleague Chris for assisting me in setting up this script. He is the “go to guy” when it comes to scripts and its wonderful capabilities. Cheers.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s