robocopy copy files from one server to another...?

I have a 2003 server and would like to copy data, over 800G to a new 2012 server. Question, my experience with Robocopy is it works better local drive to local drive, with this understanding can I use it to copy data from server to server?

Question #2 are these the correct commands to copy data with permissions?

 Robocopy "D:\data1" "E:\data1" /E /SEC
 
/e: Copies subdirectories includes any empty directories.
 
/sec: Copies files with security.
LVL 17
WORKS2011Austin Tech CompanyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
Local is faster than over the network for sure. And yes those are the correct commands. I would use /ZB as well to use backup mode (vss) for files that the user I am logged in as may not have permissions.
0
oBdACommented:
You most certainly can use robocopy to copy files from one server to another: I've used it to copy TBs of data without issues.
Important things to know:
- robocopy will by default only copy files that aren't in the target folder already (based on size and date), so you can just run the same command several times to update the target if the source has changed since the first copy.
- You can use /mir to mirror the source directory tree when you're running the copy several times to transfer changes since the initial copy; /mir will delete files that aren't in the source anymore. /mir already includes /e.
- /sec does not copy owner or audit information. You can either use /copyall to copy everything, or use the /copy:<copyflags> option (Data, Attributes, file Time, Security, Owner, aUdit). "/copy:DAT" is default, /copy:DATS is equal to "/copy:DAT /sec", "/copy:DATSOU" is equal to "/copyall".
- If your 800GB of data consist of thousands of files and folders (not just a few large files), you'll want to run a first "copy" with the option "/create"; this will create the folder structure with empty files as placeholders and will make sure that the MFT doesn't get fragmented when the real data arrives.
- You'll definitely want to use /r:<retry amount> and /w:<wait in seconds> , otherwise a single failure will be retried up to a million times every 30 seconds, which is quite a long time.
- With 800GB worth of files, you'll want a log file, too, specified with "/log:<LogFile>". You can usually safely use /nfl (no file list) and /ndl (no directory list) to suppress the logging of successfully copied files; errors will still be logged.
- When using a log file, use /tee (if you want to see the output on the console as well), and especially /np (no progress), because the progress display uses control characters that will not look good in the log file.
- Both /z (restartable mode) and /b (backup mode) slow down the copy because of the overhead involved. /z is only useful if you're copying really large files and expect connection losses such that the script will have to be restarted. /b does NOT use vss (robocopy can't copy open files), it uses backup mode to access files; the user running the script will have to be in the group "Backup Operators". If the Administrators group has (or should have) full access over the folder tree, you don't need it.
- Since robocopy in Windows7/Server 2008 R2, you can use /MT to do a multi-threaded copy; this can speed things up a bit.
So to sum it up, the following command transfers everything and can be repeated any number of times (on the W2k12 machine, in an elevated prompt if UAC is active):
robocopy.exe "\\W2k3Server\SomeShare" "D:\SomeSharedFolder" *.* /mir /copy:DATSOU /r:1 /w:1 /nfl /ndl /mt /tee /np /log:"robocopy_20130907.log"

Open in new window

If you run into a lot of "Access denied" errors (where access is (more or less) rightfully denied - which is rather pointless because an administrator always can take ownership and re-assign any permissions he wants), add /b to the options.
As mentioned above, if this is about a lot of files, the very first copy should be done with the "/create" option, followed by a regular copy.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
Also lower the retry time and attempts to lower number, put in the parameter to continue if error is generated and to log the results to a text file.  (I am working off a tablet and don't have access to robocopy to provide you the syntax but if you need it, let me know and I will fire up the good old laptop)
0
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.

WORKS2011Austin Tech CompanyAuthor Commented:
quick question can I do this while the server is in production or do I have to take it off the network and join the two servers together through a separate switch? I believe there's a command that allows to copy while in production...note it being the weekend there's not allot going on with this particular server.
0
oBdACommented:
You can just start it whenever; any files open will be logged as errors, but most of them should copy fine. Then you can just copy over the rest in a second run.
While in production, you might want to leave out the /mt switch, and if it slows down your network still too much, stop the copy with Ctrl-C and try the /ipg: switch (a formula to start with is at http://en.wikipedia.org/wiki/Robocopy).
0
WORKS2011Austin Tech CompanyAuthor Commented:
@oBda \\W2k3Server\SomeShare" "D:\SomeSharedFolder"....concerned with this part, I don't have a folder to copy data into I'd like to copy to the root on the new server. There aren't any folders yet.
0
oBdACommented:
Personally, I'd create a root folder "Data" or whatever and put all the user/department files in tis folder. Otherwise, just D:\ (no quotes).
0
WORKS2011Austin Tech CompanyAuthor Commented:
I know, agree but there is several apps that run with the data so changing anything does more harm than good.

For some reason it's saying robocopy does not exist or is not a valid command.
0
oBdACommented:
If you're running that on the W2k3 server, that's normal; robocoopy was part of the Resource Kit Tools (http://www.microsoft.com/en-us/download/details.aspx?id=17657); this version will not support /mt.
On the W2k12 server, it should be in "C:\Windows\system32", which should be in the "Path" environment variable.
0
WORKS2011Austin Tech CompanyAuthor Commented:
the word "purge" scares me, it's thinking with a curser right now but I don't see any data showing up in the destination.

did I mention the word purge scares me
0
WORKS2011Austin Tech CompanyAuthor Commented:
This is all that happens for the last hour in the log and in the DOS prompt.

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows     ::     Version XP010
-------------------------------------------------------------------------------  

Started : Sat Sep 07 15:14:55 2013

   Source : \\server123\D$\
     Dest : R:\E$\

    Files : *.*
          
  Options : *.* /NDL /NFL /TEE /S /E /COPYALL /PURGE /MIR /NP /R:1 /W:1

------------------------------------------------------------------------------
0
oBdACommented:
There should be data showing up in R:\E$.
You don't see anything because of the /nfl and /ndl. If you want to have the complete output, remove these. Since you've chosen to not write to a log file anyway, it doesn't really matter.
"/Purge" is coming from the /mir; robocopy "translates" /mir into "/purge /e". It just means that it will delete existing files in the target that are not in the source. If you're starting with an empty target folder, then it will delete nothing.
0
WORKS2011Austin Tech CompanyAuthor Commented:
thanks now I can see all the files moving problem now is everything is copying to a folder named E$ on the target, it's hidden in this folder which I can get too if I choose to see hidden files but some workstations won't as well I prefer to have it copy to the E drive on the target which is not shared without the $ sign. In other words I need to get the data not to show up in the folder E$ on the target.
0
oBdACommented:
The hidden attribute is an error in robocopy that seems to happen when copying into or from a drive root. Never had it happen when copying from a folder to a folder.
Anyway, to correct it on the current folder, you can use
attrib -s -h R:\E$ /s /d
assuming that there are no real system files in this folder.
You can add /A-:SH to your robocopy command line to prevent this from happening on further copies.
Another possibility is to make a batch file with several robocopy commands, one for each folder in the root that you want to copy, then that attribute issue shouldn't happen.
And robocopy copies into the target folder you specify; it will create this folder if it didn't exist before the copy. So what is this "R:"? Is this a mapped drive on yet another machine? If so, then you just need R:\ (don't use quotes for this) as target folder.
If there is already other data on the root of the target drive, you can't do a root to root "mirror" (because the target drive will look exactly like the source drive after the copy, with the former contents gone), so you'd have to revert to the batch script above with one copy command per folder in the drive root you want copied. That's why it's useful to keep all the user files inside one dedicated folder instead of the drive root.
0
WORKS2011Austin Tech CompanyAuthor Commented:
THANK YOU for all your help, do you mind helping letting me know where it would go in this

C:\Program Files\Windows Resource Kits\Tools>robocopy \\server123\D$ R:\E$ *.* /mir /copy:DATSOU /r:1 /w:1 /tee /np /log:"robocopy_20130908.log"
0
oBdACommented:
The attribute removal? Options for robocopy can go pretty much anywhere after the first three arguments (source, target, filemask):
robocopy.exe \\server123\D$ R:\E$ *.* /mir /copy:DATSOU /a-:SH /r:1 /w:1 /tee /np /log:"robocopy_20130908.log"

Open in new window

0
WORKS2011Austin Tech CompanyAuthor Commented:
It's still copying data in the E$ folder, any other ideas?
0
oBdACommented:
As I said before: if you want to copy directly to the root, specify the root as target folder (and with /mir, make sure the target drive doesn't contain any data you don't want deleted, because it will be a mirror of the source after the copy!)
robocopy.exe \\server123\D$ R:\ *.* /mir /copy:DATSOU /a-:SH /r:1 /w:1 /tee /np /log:"robocopy_20130908.log"

Open in new window

0
WORKS2011Austin Tech CompanyAuthor Commented:
oBdA I ended up creating a folder and moved the data into this. THANK YOU for all your knowledge and sharing this.

If I need to open another question let me know, it looks like the 1T data is close, it's around 780G copied over however the server goes into production in about an hour. Am I right thinking that letting the data finish copying then run the same command again this evening will copy over any data that changed today? Then I all I have to do is change computer name, IP address and disconnect the source server?
0
oBdACommented:
If with "the server goes into production in about an hour" you mean the source server, then yes, just run the same command again. robocopy will not copy files that already exist in the target again (based on time stamp and size), so the second run will be significantly faster, and with the /mir, it will delete all files in the target that your users will delete today.
0
WORKS2011Austin Tech CompanyAuthor Commented:
I'm assuming it will run through all the files again, it appears there is allot going I'm curious how long it will take to verify 1T data.
0
oBdACommented:
Yes it'll have to compare source and target. How long it'll take depends obviously on the amount of files and folders, the network speed, and the storage speed on the old server.
0
WORKS2011Austin Tech CompanyAuthor Commented:
OUTSTANDING help worked great, thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.