robocopy for file server migration

Posted on 2014-01-10
Medium Priority
Last Modified: 2016-06-01
I've got an antiquated windows 2003 R2 file server and have configured a new 2008 R2 VM to serve as the new file server.  Been using Robo Copy to migrate shares to the new server.  It's an efficient tool.

The only problem I'm running into are some problem directories in shares yielding an 'access is denied' in robocopy.  The odd thing is I'm using a domain admin account and the same account not only has full control over the directory, subdirectories, and files but is also the owner of all these objects.

This is only happening for a very small sample size of the data being migrated.

Just curious if anyone has run into this before.  I'm a little stumped as to why an owner of a file or folder would have difficulty copying.  Permissions on the destination drive are full control as well for the user.
Question by:isroccanoub

Assisted Solution

Beartlaoi earned 400 total points
ID: 39771769
If someone has the file open in a non-sharing mode, that will also give that error.
Have you tried /B or /ZB ?
Another way is to use a shadow copy, I can give more details on that if needed.
LVL 30

Assisted Solution

pgm554 earned 400 total points
ID: 39771828
Use Shadowcopy from Runtime.org

It uses VSS


Assisted Solution

rawinnlnx9 earned 800 total points
ID: 39771944
Don't use robocopy. Use the DOS XCOPY it's RAD and it continues even if an error happens. You cannot control the errors but I think at the end it lists files that were not copied.

Here is an example. I'm suppressing the process so that it does not show files being copied.

C:\Users>xcopy /E/C/I/Q/R/ *.* C:\Source\

Now I think you can actually output the list of source and destination to a text file using the  > character. Robocopy was a huge let down for me.

C:\Users>xcopy /?
Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
                           [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
                           [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B]

  source       Specifies the file(s) to copy.
  destination  Specifies the location and/or name of new files.
  /A           Copies only files with the archive attribute set,
               doesn't change the attribute.
  /M           Copies only files with the archive attribute set,
               turns off the archive attribute.
  /D:m-d-y     Copies files changed on or after the specified date.
               If no date is given, copies only those files whose
               source time is newer than the destination time.
               Specifies a list of files containing strings.  Each string
               should be in a separate line in the files.  When any of the
               strings match any part of the absolute path of the file to be
               copied, that file will be excluded from being copied.  For
               example, specifying a string like \obj\ or .obj will exclude
               all files underneath the directory obj or all files with the
               .obj extension respectively.
  /P           Prompts you before creating each destination file.
  /S           Copies directories and subdirectories except empty ones.
  /E           Copies directories and subdirectories, including empty ones.
               Same as /S /E. May be used to modify /T.
  /V           Verifies the size of each new file.
  /W           Prompts you to press a key before copying.
  /C           Continues copying even if errors occur.
  /I           If destination does not exist and copying more than one file,
               assumes that destination must be a directory.
  /Q           Does not display file names while copying.
  /F           Displays full source and destination file names while copying.
  /L           Displays files that would be copied.
  /G           Allows the copying of encrypted files to destination that does
               not support encryption.
  /H           Copies hidden and system files also.
  /R           Overwrites read-only files.
  /T           Creates directory structure, but does not copy files. Does not
               include empty directories or subdirectories. /T /E includes
               empty directories and subdirectories.
  /U           Copies only files that already exist in destination.
  /K           Copies attributes. Normal Xcopy will reset read-only attributes.
  /N           Copies using the generated short names.
  /O           Copies file ownership and ACL information.
  /X           Copies file audit settings (implies /O).
  /Y           Suppresses prompting to confirm you want to overwrite an
               existing destination file.
  /-Y          Causes prompting to confirm you want to overwrite an
               existing destination file.
  /Z           Copies networked files in restartable mode.
  /B           Copies the Symbolic Link itself versus the target of the link.
  /J           Copies using unbuffered I/O. Recommended for very large files.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.

C:\Users>xcopy /E/C/I/Q/R/ *.* C:\Source\

Open in new window

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 39772490
thanks for the responses.  this is something I'll be digging into mid next week.  I'll post the solution used once we get there.
LVL 57

Expert Comment

ID: 39773471
Where are you using it at? ON 2008 or 2003? On 08, you have UAC, so dom admins are not treated as members of the administrators group until they elevate.
LVL 81

Assisted Solution

arnold earned 400 total points
ID: 39773545
Windows 2003 r2 and newer system can use DFS-replication

Make sure to use the windows 2003-R2 as the basis of the DFS-replication group this way the data will be copied along with the permissions/ownership from the 2003 r2 to the windows 2008.

Note further than updates on the 2003 R2 will be propagated automatically when the file is closed.
Redefining the share as a DFS share, will provide for a seamless transition in the future.
Setting up referral as a failover (one node primarily, the other on failure) will deal with issues where only one person can edit a file at a time.

Preconfigure the destination directory on the windows 2008 with the appropriate ownerships.
The setup is a two minute process and you are done.

Assisted Solution

rawinnlnx9 earned 800 total points
ID: 39773695
Oh yeah that reminds me of this tool... It's nifty. I actually have used it in many, many situations especially if DFS isn't an option.

Microsoft SyncToy. It's a UI it's pretty slick.

Accepted Solution

isroccanoub earned 0 total points
ID: 39789839
These are all interesting alternatives.  For the present, I remain committed to migrating the file server in a homogenous manner (i.e. continue with robocopy).

Robocopy has largely worked seamlessly; 11 shares, in excess of six million files, nearly 6 TB of data.  The copies have been smooth and fast.

Again, the only problems I've run into are with the 11th share and some subfolders within (e.g. users>employee name>subfolders>files).  I have set myself to be the owner at the 'employee name' level as well as having full control for all subfolders and files.  Despite being an owner with FC, I am unable to copy the files to a new volume (i.e. with right click copy and paste or robo copy).  Access is simply denied, it's puzzling, and something I've not encountered previously.

With some research, I believe I have found the solution.

In the first failing instance, the UNC path length is exceeding 255 characters.  I have migrated these target subfolders to the root of the share and they are now copying as expected.

The second failing instance involved a user with a linux vm using samba to backup his SVN database to the windows file server.  In this case, the user has a local copy so it's something that can be trued up once the new file server is operational.

Whether or not this research is truly correct, the applied solutions are going to meet the project's ultimate goals.

Expert Comment

ID: 39789883
That's actually pretty sound. I think you've tracked down your bugs. The 255 char limit is extremely irritating and I'm surprised that Robocopy didn't provide you with more feedback regarding the errors.

Glad that you do have it working though. I think down the road you should implement a DFS system. Then this task will be forgotten and it won't consume more time than it takes to set up the DFS and let it replicate.

Good on you for solving your own problem.

Author Comment

ID: 39789951
DFS is the list to implement.  thanks to all for your input.  It's always educational to absorb all the different means/ideas to the same end.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Log files are useful in diagnosing and repairing problems.  This is a list of common log files and their standard locations that I've compiled.   While this is not exhaustive, it is a pretty good list that I've found to be useful.  I may update it f…
Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting an…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

850 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