Is it possible to migrate local profiles to user profile disks? RRS feed

  • Question

  • Hi guys, 

    Is there an easy way to migrate local user profiles on an remote desktop server to user profile disks? I am replacing a Server 2008 R2 and want to start using UPD's instead on a Server 2012 R2. 

    Best regards,


    Friday, February 7, 2014 10:37 PM


All replies

  • Hi Hasan,

    Thanks for your posting in Windows Server Forum.

    As per my research, you can able to achieve your data by choosing the option “Store all user settings and data in the user profile disk” would obviously capture everything normally stored under C:\users\<username> and add that to the UPD. But please notice however that you can only select the roaming part of your user profile data.

    On UPD profile is stored in a .VHDX file specific to your account which is placed on a central share. Upon logon a mount path is created under C:\Users\<username> that points to that .VHDX file on the share. This makes the solution fully transparent to the Operating System and applications. If you’ve used UPD before you will have noticed that the filenames of the .VHDX files hold the users SID, not the account name.

    For more information, please refer below articles. (You can refer below article for Server 2012 R2)

    1.  Using User Profile Disks (UPD) in combination with predefining the Modern UI Start Screen on RDS 2012 (appsfolder.itemdata-ms)
    2.  Working with User Profile Disks on Session-Based Desktop Deployments

    Hope it helps!

    Monday, February 10, 2014 3:50 AM
  • I don't think you understood my question or maybe I am not understanding your reply... I already have an RDS server with local users on it, how do I migrate these profiles to UPD? I know how UPD works, but I can't find a tutorial/best practice for migrating to UPD from existing servers with local profiles. 

    Best regards,


    Monday, February 10, 2014 7:31 PM
  • Hi Hasan,

    Thanks for your comment.

    Initially sorry for misunderstanding your comment. But in your case, I suspect that it cannot be possible the way you want to migrate. You need to migrate them manually. Please check below thread for your information.

    1.  Win 2012 User Disk profile
    2.  Understand User profile transitioning from physical to virtual environment using Server 2012 'user profile disk'

    Hope it helps!

    Wednesday, February 12, 2014 6:52 AM
  • Hi Hasan,

    Do you need any other assistance? If there is anything we can do for you, please let us know.

    Friday, February 14, 2014 1:53 AM
  • Thanks, I will try to see if I can script my way out of it.


    Sunday, February 16, 2014 1:18 PM
  • Hi Hasan,

    Thanks for your understanding and Support. If you want any more solution in future, kindly place your post in Forum.

    BTW,  we’d love to hear your feedback about the solution. By sharing your experience you can help other community members facing similar problems. 

    Monday, February 17, 2014 1:42 AM
  • Hi Hasan,

    Are you able to script it out?

    I am yet to test on how to move user profile. In your case, user profiles might be residing on RDS server if you are not using roaming profiles. Therfore you will need to manually copy the files from your RDS server to User profile Disk. On the other hand, roaming profiles are created on shared folder in network(if implemented using GPO or from ADUC).  User profiles gets copied to RDS server when user logs in and copies back to shared network when user logs off.

    So in your case, if you implemented User Profile Disk while your users are already in roaming profile, the user profiles from shared network will be copied to C:\User\%USERNAME% when user logs in. Since C:\Users\username is stored in User Profile Disk thus this process updates your User profile disk. Once you have your User profile disk  updated with user roaming profile, you may remove the roaming profile from GPO or ADUC.

    Now this is only a theory and yet to be tested next week.

    Wednesday, October 8, 2014 12:59 PM
  • any luck with this?  doesnt seem to work for me.  the upd creates but the contents never copy to it
    Friday, July 3, 2015 9:36 AM
  • Anyone know if this method works?

    We also want to move from Roaming Profiles to User Profile Disks AFTER the RD Session collection has already been in use.

    James - Right Size Solutions

    Monday, May 16, 2016 9:17 PM
  • I am also looking for a solution to move Win7 profiles to Win10 VDI Pool.  Testing USMT however it presents challenges in a Read Only Pooled desktop.  May work on RDS though.
    Tuesday, August 23, 2016 6:25 PM
  • Hi All,

    Any reply for a working solution? Beacause i have the same issue, "Migrate from local to UPD"


    Tuesday, October 17, 2017 4:54 PM
  • Hi Guys, This has been my WIP yesterday and today. And I think I've cracked it. 

    We have an old 2008r2 TS and a new Server 2019 here and migration with <60 sec's downtime is the target. 

    Source files for the migration are: \\ts01\d\users\%username%

    Target are UHD's stored on the file server. 

    Pre-migrating is handy - in this case however copying the UHD-Template to UHD-SID-SID-SID (being user SID) broke the new Windows start menus. Taking a step back and looking at ActiveSetup however provided the answer. 

    From a user's perspective, they now log onto the New Terminal Server; a UHD is created by the service and they're presented with a robocopy screen for ~ 10 seconds. Using ActiveSetup We've added this to the path shown: 

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\ProfilePopulate]
    @="Script to move your files form OLD Terminal Server"
    "StubPath"="cmd c:\\admin\\populateprofiles.bat"

    This calls a batch file on the server:

    @echo off
    REM This script will map a network folder to your old folder - and copy the files over! 
    REM - map the network drive to Z: 
    net use z: \\ts01\d\users\%username%
    REM Copy the full tranche of files - except the "Application Data" folder as that tends to have a loop which quickly goes infinite filling the UHD. 
    robocopy /s /z z: d:\users\%username% /copy:datso /r:0 /w:0 /mt:64 /xj /xd "Application data*"

    It runs once, copies the files and so far - works well. 

    Good luck for those who need it in the future!

    • Proposed as answer by neg2led Friday, October 25, 2019 12:51 AM
    Wednesday, July 10, 2019 1:22 AM
  • The last solution was exactly what I needed to migrate my user profiles from the old 2008 server to a VHD disk profile.  There was a few things I tweaked - the "StubPath" had to be changed to just "c:\admin\populateprofiles.bat" and the drive letters/shares updated.  Other than that it worked perfectly.
    Thursday, July 11, 2019 1:46 AM
  • Thanks much  Adam..  Worked for me. I made just a couple of changes for my environment

    We are migrating from 2012r2 to 2016 just in case that makes any differences..

    Stubpath needed the cmd /c to work with cmd file "StubPath"="cmd /c \"D:\\Support Tools\\MigrateProfile\\MigrateProfile.cmd\""

    I also just robocopied via UNC 

    robocopy /s /z \\Servername\Userdata$\ClientName\tsprofiles\%username%\Profile\.v6 %USERPROFILE% /copy:datso /r:0 /w:0 /mt:64 /xj /xd "Application data*"

    We also on this server since the older 2012r2 is still in production. we left it with roaming profiles, but disable synchronization on the 2016 farm in the Group Policy using this part

    1. Computer Configuration\Administrative Templates\System\User Profiles.
    2. “Prevent Roaming Profile Changes from propagating to the server” to disable roaming profiles on this machine or GPO.

    Looks good, this upcoming week we test on IT staff, then go live in Janruary

    Colin Hughes

    Sunday, December 22, 2019 10:47 PM
  • Hello I've done it as follows, easy procedure:

    1-created a share from c:\users on old server

    2-created a batch and paste is on all users startup (run new task "shell:common startup") as follows:

    Xcopy /E /I /D /Y "\\OLDSERVER\users$\%username%\Desktop" "%userprofile%\Desktop"
    Xcopy /E /I /D /Y "\\OLDSERVER\users$\%username%\Documents" "%userprofile%\Documents"

    3-when user logs in to new server it will bring Desktop and documents files to new UPD, without overwriting newer files on the UPD.

    4-then you can delete the batch and share when all users are migrated.

    hope this work or at least gives you the idea for this.

    best regards...

    Thursday, January 23, 2020 4:23 PM
  • We had been using Roaming Profiles to migrate from Local Profile to UPD, but we needed something faster and better.  using the above copy commands I set out to figure out a way to make the UPD before hand while the users were logged out (after hours) here is what I came up with.  I am sure a few tweaks could still be made to it.

    $sourceServer = "RdServer"
    $localProfilePath = "\\$sourceServer\C$\Users"
    $updPath = "\\fileServer\updShare\"
    $forUseOnSourceServer = $true  #UPD being set up is for same server that local profile was on
    $templateUpd = "$updPath\UVHD-template.vhdx"
    write-host " "
    write-host "   ╔════════════════════════════════════════════════════════╗ " -ForegroundColor Yellow
    write-host "   ║                                                        ║ " -ForegroundColor Yellow
    write-host "   ║        This script must be ran as Administrator        ║ " -ForegroundColor Yellow
    write-host "   ║                                                        ║ " -ForegroundColor Yellow
    write-host "   ╚════════════════════════════════════════════════════════╝ " -ForegroundColor Yellow
    write-host " "
    timeout.exe 15
    #try to determine users from local profiles
    $profileFolders = @(get-childitem -Path $localProfilePath -Directory | Out-GridView -Title "Select Profiles to copy to UPD" -PassThru)
    foreach($folder in $profileFolders)
        $name= $folder.name
        #try to find user account for the name
        write-host "__________________________________________________________________"
        write-host "Profile folder $name" -ForegroundColor Cyan 
        $user = @(Get-ADUser $name -Properties objectSid)
        $sid = $user.objectSid
            $userUpd = "$updPath\UVHD-$sid.vhdx"
            #see if UPD already exists
            if(test-path $userUpd)
                #upd already exists
                Write-Host "Found UPD for $name - $sid" -ForegroundColor Cyan
            else {
                #UPD does not exist, copy template to new file
                Write-Host "Make UPD for $name - $sid" -ForegroundColor Cyan
                Copy-Item -Path $templateUpd -Destination $userUpd
                timeout 5
            #mount UPD for copying data
            write-host "Mount vhd for $name" -ForegroundColor Cyan
            $disk = Mount-DiskImage -ImagePath $userUpd
            #get drive letter
            $Drive = Get-Partition (Get-DiskImage -ImagePath $userUpd).Number | Get-Volume
            $drivePath = $Drive.DriveLetter + ":\"
            Write-Host ("Drive path is " + $drivePath)
            timeout 5
            #now run robocopy from old profile path to new UPD path
            write-host "Copy $($folder.fullname) to $drivePath"
            timeout -seconds 5
            robocopy "$($folder.fullname)" $drivePath /copy:datso /r:0 /mt:64 /xj /xo /fft /xd "Application Data*" "Code Cache" /s /z
            #dismount before continuing
            write-host "dismount vhd for $name " -ForegroundColor Cyan
            Dismount-DiskImage -ImagePath $userUpd
                write-host "rename $($folder.fullname) folder " -ForegroundColor Cyan
                Rename-Item -path $folder.fullname -newname ($folder.fullname + "-Copied")
                #clear the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\{SID} key by renaming it
                write-host "rename ProfileList Registry Key " -ForegroundColor Cyan
                Invoke-Command -ComputerName $sourceServer -ArgumentList $sid -ScriptBlock {  param($sid); Rename-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$sid" -NewName ($sid + "-OLD") }
            timeout 5

    James - Right Size Solutions

    Wednesday, January 29, 2020 7:21 PM
  • Hi James,

    Did you ever try this in production?

    I created a script that performs some of the tasks in your script, plus a lot of things specific to our environment. While testing individual users everything looks fine, but with multiple users at the same time we get an error: "Disk offline because it has signature collision with another disk online". 

    Looks to me that RDS itself does more than just copying the template when the UPD is created for a new user.

    I will try and find a solution for this, did you have the same issue?


    Tuesday, May 12, 2020 8:30 AM
  • Found the solution:

    After your line:
    $disk = Mount-DiskImage -ImagePath $userUpd

    you should add:
    # create a new signature
    $randomSignature = [uint32](Get-Random -Maximum ([uint32]::MaxValue))
    $disk | Set-Disk -Signature $randomSignature

    That will do the job!
    Tuesday, May 12, 2020 10:35 AM
  • Perfect ! Thank you so Much :)
    Wednesday, May 13, 2020 3:23 PM
  • I have applied that script along with the "you should add:
    # create a new signature
    $randomSignature = [uint32](Get-Random -Maximum ([uint32]::MaxValue))
    $disk | Set-Disk -Signature $randomSignature"

    that @ad vdb mentions but my start menu is broken when i log in with the users. Did you have any sort of trouble with that?

    Thursday, May 21, 2020 4:56 PM
  • No, haven't seen that. Did you check NTFS rights on the folders in the user profile on the UPD?

    Friday, May 22, 2020 8:33 AM