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
Windows OSWindows Server 2008Windows 10AzureWindows Server 2016

Avatar of undefined
Last Comment
arnold
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.
Avatar of arnold
arnold
Flag of United States of America image

Save yourself tine and use dfs management if this is an AD domain

It will synchronize as Sara being, modified/added.
Avatar of kevinhsieh
kevinhsieh
Flag of United States of America image

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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of arnold
arnold
Flag of United States of America image

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.
Windows OS
Windows OS

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo