Use Robocopy to Migrate Windows Shares

Page

Technote (applies to windows):

Recently I encountered a situation where I needed to copy a directory structure and folder permissions, but not the files contained within. To do this I used the robocopy utility included in most recent versions of Windows client and Windows Servers.

Copy directory structure w/ permissions:

Option 1: robocopy “source” “destination” /e /z /SEC /xf * 

Option 2: robocopy d: f: /mir /Z /PF /XF *

or

Option 3: robocopy d: f: /e /z /xf *

To copy the entire contents from one drive/share to a different drive/share including security permissions try this

Robocopy “Source Share” “Destination Share” /zb /mir /copyall

i.e. “\\Source-Server\Share” “\\Destination-Server\Share” /zb /mir /copyall

Or, from source drive to destination drive

Robocopy “P:/” “Q:/” /zb /mir /copyall