Using Robocopy to Migrate Files to a New Server



Posted on: July 2nd, 2013

As an Operations Engineer at PEI, I have the opportunity to fulfill a wide range of requests for our clients. Recently, when migrating a physical file and print server to a newly build virtual server I discovered how useful the Robocopy command is.

Robocopy, or Robust File Copy for Windows, is built in to the Windows command line on Windows 7/8 and Windows Server 2008 or greater. The value of this command in a file and print server migration is the fact that it can copy an entire directory structure while leaving parameters intact (permissions, last modified dates, etc.)

The command that I recommend executing in a simple FP Server migration is below. This is assuming you are running it from the new FP Server:

ROBOCOPY “\\path_to_existing_share” “X:\path_to_new_share” /MIR /R:5 /COPY:DAT /log:”C:\log.txt”

Let’s dissect this command to see what exactly we are doing here:

1) “\\path_to_existing_share” “X:\path_to_new_share”

a. We are telling ROBOCOPY to move files from the existing network share to the local path to the new share location.

2) /MIR

a. Mirrors the directory tree

3) /R:5

a. Specifies the number of retries on failed copies. I recommend setting this to 5 to prevent and endless retry loop. The default value if not specified is 1 million retries


a. Copies Data, Attributes and Timestamps

5) /log:”C:\log.txt

a. Places a copy log in the root of C:\

By running the command as shown above, you will accomplish a simple and effective data transfer between two locations. To see a full list of ROBOCOPY switches, head to the following TechNet Article:

Andy Shaffer, PEI


One comment on “Using Robocopy to Migrate Files to a New Server

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s