• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 107
  • Last Modified:

robocopy for file server migration

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.
6 Solutions
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.
Use Shadowcopy from Runtime.org

It uses VSS

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

isroccanoubAuthor Commented:
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.
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.
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.
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.
isroccanoubAuthor Commented:
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.
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.
isroccanoubAuthor Commented:
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.
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.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now