Link to home
Start Free TrialLog in
Avatar of jsarinana
jsarinanaFlag for United States of America

asked on

COPY FOLDER STRUCTURE WITH FILES AND PERMISSIONS

COPY FOLDER STRUCTURE WITH FILES AND PERMISSIONS from Windows Server 2008 R2 STD  to Windows Server 2016 STD

On Windows Server 2016 I have the 2008  server mapped
(F) (\\server2008) which has a shared folder "Share"
I want to copy "Share" folder to a local drive G:\Share on the Server 2016


I found this question COPY FOLDER STRUCTURE WITHOUT FILES BUT WITH PERMISSIONS

with solution: XCOPY "X:\Source Folder\" "Y:\Destination area\" /T /E /O

this kind of worked by doing a: XCOPY f:\Share g:\Share\ /T /E /O
what this did was copy the sub-folders in Share with all the folders and subfolders but empty
Avatar of kevinhsieh
kevinhsieh
Flag of United States of America image

robocopy \\source_server\share\directory \\destination_server\destination_share\directory /copyall /e /r:0 /w:1

Open in new window


Will copy all files from source to destination including all attributes, and all subdirectories.

If you use /mir, it will make the destination look like the source, including by deleting files at the destination that are not at the source.

You can run the command multiple times to make incremental updates. This is often done on busy file servers. The first copy may take days. The next runs will go much faster.

Of course, if these servers are VMs like 99.999% of all servers should be these days, just disconnect the VMDK/VHDX from the old VM and attach to the new VM. Migrate share information via registry updates.

https://support.microsoft.com/en-us/help/125996/saving-and-restoring-existing-windows-shares
use robocopy with the /secall
xcopy  /T          

Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories.
Save yourself tine and use dfs management if this is an AD domain

It will synchronize as Sara being, modified/added.
DFS Replication is risky. Just this week I worked with someone that lost most of their files because they didn't understand what primary meant when starting DFS Replication. IMHO robocopy is faster, doesn't require monitoring for failure, consumes less disk space, and takes less I/O.
ASKER CERTIFIED SOLUTION
Avatar of Hello There
Hello There

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
FYI, of this is an active share, you need to rerun this command until you are certain that no user is still accessing it and making changes.