Copying file from one network share to another

Posted on 2009-02-23
Last Modified: 2012-08-13
Hello EE,

I am about to start pulling my hair out over this.  I have spent most of the day trying to find a away to copy several hundred GB of data from one drive to another on my file server without blowing away all the permissions and share settings.  I have been toying with XCOPY and ROBOCOPY all day and have been unsuccessful.  Once I think I have it working correctly, I am unable to duplicate the results.  I have read through numerous posts here and followed many of the links already provide and to now avail.  Does anyone know a way to accomplish this?  I realize that preserving the share names many not be possible but I am for more concerned with the the countless various NTFS permissions that are in place throughout the directory tree.  here are a few of the commands I have been running through.

robocopy \\server\share$\path \\server\share$\path /COPYALL /E /V /LOG:C:\ROBOCOPY.TXT

Additionally, I want to send the output to a text file to view all skipped and failed files.

There has got to a be a working script out there somewhere to accomplish this task.


Question by:CityofKerrville
    LVL 10

    Expert Comment

    Are you your servers in a domain ?
    Unless both of your servers are members of the same domain, different security ID-s will exists on each server. It's impossible to copy with permissions from one site to the other in such case. Or more precisely, the permissions on the other side would be useless.

    Author Comment

    It is actually all on the same server but on different drives.  

    1 iSCSI SAN drive (Source)
    1 Local drive (Destination)
    LVL 82

    Accepted Solution

    The basic command looks okay.
    But you usually don't need /v, especially not if you're copying large amounts of files. I usually use /nfl and /ndl, because success entries are rather useless; even with /nfl and /ndl, errors will be reoprted.
    You might want to define /r:X and /w:X; if you have a stable network connection, set both of these to 0. if the connection drops sometimes, and if you're copying large files, use /z and set /r and /w to reasonable values.
    Then it's best to have either the source or the target folder local; that way, the data doesn't have to pass through the client's network stack twice.
    As far as copying the permissions goes: create the target folder manually, uncheck the inheritance for this folder, and configure the permissions the same as the source folder; I've made the experience that robocopy sometimes has problems copying the permissions for the target folder (only). The rest works flawlessly, and I've used successfully to migrate data in the TB range.
    Check out robocopy.doc in the installation folder, it's a pretty good documentation.
    LVL 10

    Expert Comment

    Hm, why are you using UNC names, try using paths and drive letters instead.

    Author Comment

    I guess I completely neglected to try and run the command locally.  I had been doing it remotely and may have a working robocopy string that needs to be tested a little more.

    Author Closing Comment

    This was exactly what I needed.  I even found this

    Made it a snap.  I copied all 64gb over night and was able to go back through the failure list and cleanup this morning.  Thanks for the help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now