File server migration using Robocopy

I recently was tasked with moving one of our file servers from one physical server to another.  The file server had a bunch of files/directories with different permissions used by our finance/IT/Legal team. There are two things to keep in mind when it comes to permissions. There are NTFS permissions that the robocopy command will copy over and then there are the share level permissions which are not copied over with robocopy. The share permissions are stored in the registry, I manually entered the share level permissions on the destination.

Here is the command I used.

This command will mirror a D: drive on FS01 to the D: drive on FS02.
CAUTION: If destinaton has files that do not exist on the source, the destination files will be deleted (/MIR option).

robocopy \\FS01\d \\FS02\d /MIR /E /ZB /DCOPY:T /COPYALL /R:1 /W:1 /xd “$RECYCLE.BIN” “RECYCLER” “System Volume Information” /V /TEE /LOG:Robocopy4.log

\\FS01\d :: Source Directory (ie: “D:\My Music” or D:\ or \\server\d)
\\FS02\d :: Destination Dir
/MIR :: Mirrors Destination with source. If destinaton has files that do not exist on source the destinaton files are deleted.
/E :: copy subdirectories, including Empty ones.
/ZB :: use restartable mode; if access denied use Backup mode.
/DCOPY:T :: COPY Directory Timestamps.
/COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU). Copies the Data, Attributes, Timestamps, Ownser, Permissions and Auditing info
/R:n :: number of Retries on failed copies: default is 1 million.
/W:n :: Wait time between retries: default is 30 seconds.
/xd :: exclude the following paths
/V :: produce Verbose output, showing skipped files.
/TEE :: output to console window, as well as the log file.
/LOG:file :: output status to LOG file (overwrite existing log).

Other Robocopy commands:
Copies permissions, ACL, Timestamp, etc as above, but it does NOT mirror (/MIR). This command just copies from source to destination. So if certain files already exist on destination but don’t exit on source, robocopy will not touch them.

robocopy D:\ \\FS02\d /E /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy1.log

This entry was posted in Microsoft, Windows and tagged , , , , , . Bookmark the permalink.

6 Responses to File server migration using Robocopy

  1. Colins Ankit says:

    I have used robocopy and didn’t find any satisfactory results. It all gets stuck at some point or another, one software which I found interesting and would recommend to anyone is GS RichCopy. Its been 2 years using this and till now no complaints whatsoever. Some of its extra features include NTFS support, multi threaded file transfer, and many more. Its worth the money. Hope it helped you all!

  2. Emiley Rose says:

    I agree with Colins Ankit, I have used GS Richcopy 360 and its the best software which I have used till now! I have used terracopy, robocopy and what not! But my problem was solved by GS Richcopy 360. This software is ahead of its competitors. Although its paid software but the features and it’s reliability is amazing. Highly recommended software from my side! Try it!

    • dd says:

      Sounds like a marketing campaign for GS Richcopy, I used robocopy many times working as a sysadmin and it works flawlessly. I wouldn’t waste any time with paid tools when robocopy is free and comes loaded with windows.

      • Sophia Jason says:

        Sounds like a marketing campaign for a free and waste tool- Robocopy. I wouldn’t also waste my time looking at that black command line, which isn’t even provide multi threaded file transfer. Free stuff are like that only, works sometime and sometime don’t. I spend my money on something useful, to save my time! I use GS Richcopy!

  3. vikas khandola says:

    use robocopy

  4. george renee says:

    Just in case things go wrong, I’m going to generate a log of whats going on, so I can see any errors or files skipped when I’ve finished. On the root of the destination servers C: drive create a folder called ROBOCOPY-Logs, and within this folder create another folder called Last-Copy,I have used robocopy and it is good but at times it hangs when copying large files I dont know why but its frustrating. I tried to find solution for this but nothing worked. So I decided to try some other software. Then I found GS Richcopy which works like a charm its simple to use does not hangs and provides multi threaded file transfer. Try it its good!

Leave a Reply

Your email address will not be published. Required fields are marked *