Windows – Migrate folder user permissions in a windows file server migration

file-permissionsmigrationwindows

First of all I'm not a Windows administrator so that perhaps this question is total nonsense.

We are going to migrate our Windows file server to another machine, the people who are going to do the job know how to replicate the folders and files (copy/paste perhaps?) but they don't know how to migrate the file and folder user permissions.

Is there a tool to do it automatically?

By searching through Stackoverflow I see there is a windows command "CACLS" which shows and sets permissions, so that i can write a program which loops through the file system and calls the command to show and set the permissions.

Is this aproximation ok?

P.S. Sorry for my bad english

Best Answer

The XCOPY command will copy permissions when the "/O" or "/X" switches are set. You can accomplish most simple file/folder/permission migrations just by doing:

XCOPY "source" "destination" /E /X /C /H /K

If you have deep folder hierarchies with long paths you'll need a "heavier duty" tool.