Use Robocopy to migrate folder and files including permissions and datestamps

There are two (lengthy) Robocopy commands to use in order to migrate a folder and its contents to a new location (for a file server migration for example) whilst retaining the ACL permissions and datestamps on both files ad folders. You can do an initial 'seed' of the destination with the following (note that this creates the new folder in the destination with the name specified):

robocopy "Z:\FolderName" "\\DestinationServer\ShareName\FolderName" /E /COPY:DATSOU /DCOPY:DAT /R:3 /W:5 /MT:16 /V /TS /FP /TEE /LOG:"C:\RobocopySeedLog.txt"

This outputs each filename/location to both the CLI and the specified log file. You can speed up the copy process a little by omitting the /TEE switch so the output is not shown on screen.

When you are ready to do the final cutover, you need to amend the command slightly so that any changes are captured from the source, and any files that have been moved/deleted are also updated in the destination.

robocopy "Z:\FolderName" "\\DestinationServer\ShareName\FolderName" /MIR /COPY:DATSOU /DCOPY:DAT /R:3 /W:5 /MT:16 /V /TS /FP /TEE /LOG:"C:\RobocopyDeltaLog.txt"

For further info about each switch (and the option to add progress info during the copy) see:

robocopy /?

(But I guess you knew that already)...

Related Posts

Need IT Help?

If you need assistance please feel free to reach out to us.