Link to home
Start Free TrialLog in
Avatar of DP230
DP230Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Robocopy of users profile folders?

Dear Wizards, we have a task of moving all users' drives to a new server. Each user older has its own permission.

In old server, the data is stored in this path: D:\user_data\Department_name\username ( \\OldServer_IPaddress\username$).

We'd like to copy copy all data to a new server and still keep all permissions. The new folders will be shared as: \\NewServer_IPaddress\username$

How can I ?
Avatar of bbao
bbao
Flag of Australia image

just use /MIR and /SEC switches.

ROBOCOPY sourcefolder tagetfolder /MIR /SEC
Hi DP230,
Don't get it complex. Before going please test with test data.(test sharing folders)

You can use File server Migration Toolkit from Microsoft.
You can download it from here,
https://www.microsoft.com/en-us/download/details.aspx?id=10268 

For More details Details :-
https://techcommunity.microsoft.com/t5/storage-at-microsoft/microsoft-file-server-migration-toolkit-1-2-available-as-a-free/ba-p/423958 


Or if you prefer to use RoboCopy, Please refer this,
https://www.petenetlive.com/KB/Article/0001233 
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy 


Once you copy files to destination(new) server, please export and import following registry path from old server to new server.
HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares 

All sharing details have been saved here.
You create a separate share for everyone? That seems like the hard way. A more common practice it to put everyone under a single share.

Personally, I use DFS Namespace, so a person's personal drive would always be at something like \\ad.domain.com\DFS\Department_Name\%username% . The DFS Namespace handles the indirection to point clients to the correct share and path. This means that there is no client side updates to the new path. The actual server or server IP address is not important.
Avatar of Hello There
Hello There

This includes two steps. First, you need to copy data. If you are looking for a robocopy command, this is what we use. Run this from the destination server.
robocopy.exe "\\old_fs\d$\user_data" "d:\user_data" /e /b /copyall /MT:64 /tee /log:c:\robocopylog.log /v 

Open in new window

Now you need to share all these folders. So backup shares form the old server by exporting the Shares key on the old server. Open Regedit -> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Shares -> export this key and import it into the new server.
Avatar of DP230

ASKER

@hello there, I tried the registry method but it did not help. And my shares are not
old_fs\d$\user_data

Open in new window

it is like this:
\\old_fs\username$

Open in new window

Avatar of DP230

ASKER

The manual solution includes these steps, but it consumes lots of time since we have about 400 user profiles to do:

1. In new server, create all Departments' folder.
=> 1.1 Inside each folder, create their staffs' folder
=> 1.2 Share staffs' folders with format: \\new_IPadress\username$, grant permisions

2. In old server, use robocopy to move data from each staff' folder to their new locations in new server

3. Turn off share in those folders

So how to save time in this case?
ASKER CERTIFIED SOLUTION
Avatar of Hello There
Hello There

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DP230

ASKER

@Hello there, I created all structured folders, copied registries but it did not help, the user profile folders are lost all shared names.

Can you suggest more? we'd like to get this

User generated image
There is a condition that you have to use the same drive letter for the disk on the target server. Then it should work.
boosts. You restart the server service or reboot the new server? You need to do that after importing the registry changes.

You can change file paths in the registry file before importing.
Rebooting the server is needed. True. I forgot to mention that. Sorry.
Avatar of DP230

ASKER

Hi, after rebooted server, the shared names appeared as expected but in profiles folders, they did not have "Authenticate users" and also the owners?

I copied the structures with /xf /zb options
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DP230

ASKER

I could not use robocopy as domain administrator, because each profile folder does not have share permission for admin. How can we bulk add it to all folders?
Just robocopy again using the administrative share of the drive and add the /copyall option to include security attributes, along with all other attributes.