Copy SYSVOL to a New Location
Applies To: Windows Server 2008, Windows Server 2008 R2
If you want to relocate the SYSVOL directory, you can use this procedure to create the new directory location and copy the SYSVOL folders to the new location. By default, the root of the SYSVOL directory is located at %systemroot%\SYSVOL. To move SYSVOL properly, you must correctly copy the contents of the SYSVOL folder. A subfolder with the default location of %systemroot%\SYSVOL is also named sysvol. Ensure that you copy the root folder (%systemroot%\SYSVOL) and not the subfolder (%systemroot%\SYSVOL\sysvol).
To retain the SYSVOL security settings, you must use the proper robocopy command, as described in this procedure. To prevent conflicts, use the updated version of Robocopy available in Microsoft Knowledge Base article 979808. If you perform a simple copy and paste in Windows Explorer, security settings are not copied. In this case, you must reapply security settings. For information about reapplying security settings, see Reapply Default SYSVOL Security Settings. For information about using robocopy, see Robocopy (https://go.microsoft.com/fwlink/?LinkId=122544).
Before you perform this procedure, you must have performed the following procedures:
Identify Replication Partners. After you relocate SYSVOL, you will force replication of the changes to replication partners so that SYSVOL is updated as soon as possible on other domain controllers.
Check the Status of the SYSVOL and Netlogon Shares. Make sure that the sysvol and scrips folders are shared on the domain controller.
Verify Active Directory Replication. Make sure that you resolve any replication issues before you move SYSVOL.
Gather the SYSVOL Path Information. You must have the current path information, and you must also document the new location.
Stop the DFS Replication Service and Netlogon Service. Do not make any changes to the SYSVOL location while these services are running.
Membership in Domain Admins, or equivalent, is the minimum required to complete this procedure. Review details about using the appropriate accounts and group memberships at Local and Domain Default Groups (https://go.microsoft.com/fwlink/?LinkId=83477).
To copy SYSVOL to a new location
Open a Command Prompt as an administrator: On the Start menu, right-click Command Prompt, and then click Run as administrator. If the User Account Control dialog box appears, provide Domain Admins credentials, if required, and then click Continue.
At the command prompt, type the following command, and then press ENTER:
robocopy <Source Folder> <Destination Folder> /copyall /mir /b /r:0 /xd "DfsrPrivate" "<domain>" /xf "DfsrPrivate"
Where <domain> is the fully qualified domain name, such as contoso.com. This Robocopy command will create the destination folder. It will also exclude junction points so you can re-create them later using mklink.exe without encountering an error. If you do not exclude the junction points, mklink.exe can return an error “Cannot create a file when that file already exists.”.
The path to the SYSVOL directory that you are copying. The default location is %systemroot%\SYSVOL.
The path to the new SYSVOL location that you created in step 1.
Copies the following file information: data, attributes, time stamps, NTFS access control list (ACL), owner information, and auditing information.
Mirrors the directory tree that you are copying.
Copies files in backup mode. Robocopy uses backup mode to override file and folder permission settings (ACLs).
Specifies performing 0 (zero) retries on failed copies.
/xd "DfsrPrivate" “<domain>”
Excludes the DfsrPrivate and domain directory from the copy.
Excludes the DfsrPrivate file from the copy.
Verify that the folder structure was copied correctly. To compare the new folder structure to the original, open a Command Prompt as an administrator: On the Start menu, right-click Command Prompt, and then click Run as administrator. If the User Account Control dialog box appears, provide Domain Admins credentials, if required, and then click Continue.
Verify that the folder structure was copied correctly. To compare the new folder structure to the original, change directories to the new SYSVOL folder. To list the contents of the folder and subfolders by size, type the following command, and then press ENTER:
Compare the ouptut with the output for the original SYSVOL folder. Ensure that all folders exist and that file sizes are the same. If any folders are missing at the new location (such as \scripts), re-create them.
Verify that the security settings on the moved SYSVOL are the same as the settings on the original location.