Solved

Robocopy on Windows Server 2012 r2 syntax

Posted on 2016-09-29
11
460 Views
Last Modified: 2016-10-04
Hello Experts,

I need to copy over an entire drive from one server to another. I wanted to use Robocopy and tried the following

robocopy \\servername\G$ \\servername\g$  

I get page file error (page in use)
so I tried
robocopy \\servername\G$ \\servername\g$  /XF pagefile.sys      but it only copied over some of the folders and data.

What is the correct syntax?

thanks!
0
Comment
Question by:Member_2_7964761
  • 3
  • 2
  • 2
  • +3
11 Comments
 
LVL 11

Accepted Solution

by:
Maclean earned 251 total points
ID: 41822513
robocopy \\servername\G$ \\servername\g$  x* /E /XF pagefile.sys if not mistaken.
Worst Case you can do it using a GUI such as Roadkills Unstoppable Copier, which allows you to pause & verify copy as well. Just download the portable version for Win7/8, works fine on all server versions.
0
 
LVL 15

Expert Comment

by:Todd Nelson
ID: 41822536
Do you need to copy permissions too?

Here is a good reference with examples and syntax...
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 41822682
Of course the servernames in your command are different?
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

by:Member_2_7964761
ID: 41822820
Thanks! I will try this tomorrow. The one switch I don't see is to skip over files in use? (Page file in use) is this available?
0
 
LVL 24

Assisted Solution

by:NVIT
NVIT earned 83 total points
ID: 41822897
Your example shows you're copying to the root of the target server, which has an active pagefile.sys, which is open and locked.

Do you need to image instead?
0
 
LVL 29

Assisted Solution

by:serialband
serialband earned 83 total points
ID: 41822901
robocopy \\servername1\G$ servername2\G$ /copyall /Mir /R:1 /W:1 /xf pagefile.sys

There is no robocopy switch to skip over in use files.  You can continue to run robocopy with files in use and just have it skip over them quickly.  Basically, you can run robocopy again and again until you get most of the files, except the few system files in use.  I don't understand why you would use a pagefile on G$, which I presume is a data drive.  If the server has enough RAM, a pagefile isn't really needed.

Normally, robocopy will just error out, wait 30 seconds and retry 3 times by default.  That's too much of a delay, hence /R:1 and /W:1.  You generally want to keep all permissions and mirror the entire tree structure, if it's a file share, hence /Copyall and /Mir.  Of course, you can still skip the huge pagefile that will always be changing.


If you really need to copy files in use, there's hobocopy https://github.com/candera/hobocopy
To use Hobocopy, you'll also need to turn on Volume Shadow copy.  It will copy all files, including those in use, by copying the shadow copy version of the in use file.
0
 

Author Comment

by:Member_2_7964761
ID: 41823450
Thanks for your help! Got them copied over but still missed a lot of files plus it took 2.5 hours.  We are looking for the best solution for DR.  Is it possible to mount a network drive. This is  possible on Windows server 2012 r2?
0
 
LVL 69

Assisted Solution

by:Qlemo
Qlemo earned 83 total points
ID: 41823532
Mounting a network drive and using it is possible, but won't help in the copy process. Only if access to the UNC path is scattered over a longer period, you might gain some performance, but while running RoboCopy the paths are in use full time, so that does not apply here.

Successive RoboCopy runs should not last that long. There is overhead per file to check, but the lengthy operation is the copy itself, and that will only happen for changed files (but copy those as a whole). So if you run RoboCopy now again, it should be finished in several minutes (instead of hours).
0
 
LVL 29

Assisted Solution

by:serialband
serialband earned 83 total points
ID: 41823574
If it only took 2.5 hours for the entire copy, the successive robocopy will easily be under 5 minutes, if you have very few files changing and if you run it immediately after, unless you have numerous and constant file changes within that 2.5 hours.
0
 
LVL 11

Expert Comment

by:Maclean
ID: 41824990
Why not use DFS if you want DR for data. Its not the best solution out there perhaps, but its reliable enough, comes with windows and incrementally updates files as data changes, plus if server A fails, it will keep running on the name space using server B. I suppose this is for user data, not full system backups.
0
 

Author Comment

by:Member_2_7964761
ID: 41827987
Thanks for your help!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DNS zone 3 50
How to decline Windows updates with SCCM? 2 52
Replication in Hyper-V 8 35
SCCM 2012 "Best Practice" to use UNC paths for package data sources? 7 16
Table of Contents: Lesson 1 - Installing Windows Server 2012 (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2012/A_11592-Become-an-Administrator-Installing-Windows-Server-2012.html) Lesson 2 - Configuring Ser…
In my previous 24 VMware Articles (http://www.experts-exchange.com/ARTH_1864316.html?arthOrderBy=3&arthSort=1#arth), most featured Intermediate VMware Topics. My next series of articles concentrated on topics for the VMware Novice;   If you would…
In this Micro Tutorial viewers will learn how they can get their files copied out from their unbootable system without need to use recovery services. As an example non-bootable Windows 2012R2 installation is used which has boot problems.
In this Micro Tutorial viewers will learn how to restore single file or folder from Bare Metal backup image of their system. Tutorial shows how to restore files and folders from system backup. Often it is not needed to restore entire system when onl…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question