Robocopy switches to copy/move data

Can someone send me instructions on how to move and copy data from one server to another server?  I was told to use the following:

robocopy \\source_server\file \\destination_server\file /e /sec /x0 r:0 /log:c:\robocopy.log

Does this appear to be correct?
Lastly, I'm planning on just copying the data now and not move the data.  At some point, we'll be doing a DELTA move so all files that may have been missed or updated, become parralel to both servers data.

The destination server is Server 2003 and the source server is MS 2008.
Who is Participating?
zalazarConnect With a Mentor Commented:
Below please find some more info about using robocopy for copying data from one server to another.
If you use UNC paths for Source and maybe also for destination then make sure you have full control on the share permissions. Also make sure that you have full control on the NTFS permissions.
For perfomance reasons it's always best to start the commands on the new (destination) server. So logon with RDP or console on the new (destination) server.

As an example:
Source is: \\server\e$\Data\Groups
Destination is: D:\Data\Groups

Be very careful when choosing your source and destination. Making a mistake can be very costly.

If you have a lot of data to copy it's a good idea to first do a copy with the /CREATE option. This will minimize directory fragmentation. This will only copy the directory structure including all the files as 0 bytes files

robocopy.exe "\\server\e$\Data\Groups" "D:\Data\Groups" /CREATE /E /DCOPY:T /NP /R:0 /COPY:DATSO /LOG+:C:\Temp\robo_log1.log

Then execute a second command to copy the Data.
This is including NTFS security (S in DATSO), File Ownership information (O in DATSO) and directory timestamp (/DCOPY:T)
/NP   No progress indicator (necessary since we use /LOG+)
/R:0  Do not retry on failed file copies
Please note that the mentioned /SEC option in your question does not copy file ownership information. If this is not necessary then you can also use /SEC instead of /COPY:DATSO
The mirror option will make sure that the destination will be exactly the same as the source.

robocopy.exe "\\server\e$\Data\Groups" "D:\Data\Groups" /MIR /DCOPY:T /NP /R:0 /COPY:DATSO /LOG+:C:\Temp\robo_log2.log

To save time, all above can be done as a sort of pre-copy.
On final migration day just execute the last command again:
The mirror option makes also sure that files that are deleted on the source are also deleted on destination.

robocopy.exe "\\server\e$\Data\Groups" "D:\Data\Groups" /MIR /DCOPY:T /NP /R:0 /COPY:DATSO /LOG+:C:\Temp\robo_log3.log

After the copying is done:
1) Check the logfiles for errors and "Access denied" messages
2) Get the properties of source and destination directory with an explorer and make sure the amount of data, number of files and directories are exactly the same.

robocopy.exe "\\server\e$\Data\Groups" "D:\Data\Groups" /CREATE /E /DCOPY:T /NP /R:0 /COPY:DATSO /LOG+:C:\Temp\robo_log1.log

robocopy.exe "\\server\e$\Data\Groups" "D:\Data\Groups" /MIR /DCOPY:T /NP /R:0 /COPY:DATSO /LOG+:C:\Temp\robo_log2.log

3rd (optional)
robocopy.exe "\\server\e$\Data\Groups" "D:\Data\Groups" /MIR /DCOPY:T /NP /R:0 /COPY:DATSO /LOG+:C:\Temp\robo_log3.log

Open in new window

Steven HarrisPresidentCommented:
robocopy \\source_server\file \\destination_server\file /e /sec /x0 r:0 /log:c:\robocopy.log

/e is for copying Subfolders, including empty Subfolders
/sec is for copying with security permissions
/x0 (should be /XO - letter o not number 0) is used for excluding older files already in destination (you don't need this yet imo)
r:0 (should be /R:0) is for disabling retries on failed copies
/log:file is for writing the log to a file

Formatted correctly:

robocopy \\source_server\file \\destination_server\file /e /sec /r:0 /log:c:\robocopy.log

This is for copying the files, not moving them from location to location, so you are fine with this.
No there is a typo there, and more over try this much better

robocopy \\source_server\file \\destination_server\file /s /e /zb /sec /w:1 r:2 /log:c:\robocopy.log
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

uppercut71412Author Commented:

Can you explain what the above commands will actually do?

/s /e /zb /sec /w:1 r:2

/S :: copy Subdirectories, but not empty ones.
/E :: copy subdirectories, including Empty ones.
/ZB :: use restartable mode; if access denied use Backup mode.
/SEC :: copy files with SECurity (equivalent to /COPY:DATS).
/R:n :: number of Retries on failed copies: default 1 million.
/W:n :: Wait time between retries: default is 30 seconds.
uppercut71412Author Commented:
/zb:: restartable mode, can you explain a bit further.
/Z : Copy files in restartable mode (survive network glitch).
/B : Copy files in Backup mode.
/ZB : Use restartable mode; if access denied use Backup mode.
Did you by chance already get any further with the migration of data ?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.