Windows Server Operations Series

📁 Why You Shouldn't Robocopy Before Domain-Joining in a File Server Migration — How SID Resolution Actually Affects ACL Copying, and the Difference Between Share Permissions and NTFS Permissions

Introduction

This article is part of the Top 1% Series Complete Article Guide, and article 8.1 in the Windows Server Operations Series.

Prerequisite Knowledge

Getting the Big Picture

An NTFS ACL (Access Control List) records “who” gets a permission not as a readable string like a username or group name, but as an internal identifier called a SID (Security Identifier). A SID in the form S-1-5-21-... doesn’t directly tell either a human or the OS “who it refers to,” on its own. For the OS to translate a SID into meaningful information about who it refers to, it needs to query the SID’s issuing authority — either the local computer, or the domain. For a domain user or domain group’s SID, that query target is the DC. If the new file server isn’t domain-joined yet, it has no way at all to query a DC, and can’t resolve any domain SID. As a result, even when Robocopy tries to copy the entire ACL wholesale with /COPYALL, only the permission settings tied to domain SIDs end up failing to migrate correctly.

sequenceDiagram
    participant Old as Old File Server
    participant New as New File Server (not domain-joined)
    participant DC as DC
    Old->>New: Robocopy /COPYALL copies<br/>files and ACLs (with SIDs) over
    New->>DC: Tries to resolve a domain SID,<br/>but can't query — not domain-joined
    DC--xNew: No response (never joined in the first place)
    Note over New: Access permissions for domain<br/>users/groups don't get set correctly

Deep Dive Into the Fundamentals

Why Domain SIDs Don’t Copy Correctly, Even With /COPYALL

Robocopy’s /COPYALL option (internally /COPY:DATSOU) is a setting that copies not just the file’s data, but also security-related attributes together — timestamps, owner information, ACLs, and so on. When copying an ACL, Windows tries to verify whether the SID it’s about to write at the destination is an actually resolvable (i.e. valid) security principal. A local group or local user’s SID can be resolved just by looking at the destination computer’s own local account information, but a domain user or domain group’s SID can only be resolved if the destination computer is domain-joined and in a state where it can query a DC. On a destination that isn’t domain-joined, this SID resolution fails, and by default, the access control entry (ACE) for a SID that couldn’t be resolved simply doesn’t get set correctly. Since the file itself still copies normally, “the copy succeeded” looks true on the surface, but only the permissions are quietly missing — a mismatch that’s genuinely easy to overlook by appearance alone.

Another Pitfall When Local Groups Are in Use

If the old file server’s ACL used that server’s own local group (not a domain group), this problem gets even trickier. A local group’s SID is specific to the computer where that group was created, and can never be resolved from a different computer (the new file server) at all, even if that computer is domain-joined. At the destination, this SID gets treated as “an account that doesn’t exist,” ending up as what’s called a dead SID — an orphaned SID whose owner can’t be resolved. Early in migration planning, it’s worth checking whether the old file server’s ACL uses any local groups, and if so, replacing them with domain groups before the migration.

The Correct Migration Order

To avoid the problem above, you need to strictly follow this order:

  1. Domain-join the new file server first (don’t copy any files yet, at this point)
  2. Confirm domain join has completed, and that it’s in a state where it can query a DC
  3. Only after reaching this state, copy files and ACLs with Robocopy /COPYALL

With this order, the new file server stays in a state where it can query a DC throughout the copy process, so domain user and domain group SIDs resolve correctly, and the ACL carries over exactly as-is.

What a Pro Sees Here (Top 1% Understanding)

The Oversight Behind “Making It Read-Only Before Copying Keeps Things Safe”

In file server migrations, it’s common to temporarily make the old file server’s shared folder read-only, to prevent the accident of a user updating a file during the migration, causing a mismatch with the post-copy content. A question practitioners often have at this point is: “Will this read-only setting get copied as-is to the new server by Robocopy, accidentally leaving the new server stuck read-only too?”

The answer to this question becomes clear once you understand the two independent layers of access control: share permissions and NTFS permissions. If you set the read-only restriction as a share permission (the permission set at the “entrance” to the shared folder), that setting is information tied to the shared folder itself, and all Robocopy ever copies is the NTFS ACL of the files and folders themselves. Share permissions are never recorded anywhere on the filesystem, so they’re never even included in what Robocopy copies in the first place. In other words, a read-only setting made as a share permission never carries over to the new server via Robocopy at all — it needs to be explicitly reconfigured when creating the share on the new server.

What Happens If the Read-Only Restriction Was Set as an NTFS Permission?

On the other hand, if the read-only restriction was set as an NTFS permission (an individual permission recorded on the file or folder itself), the story changes. In this case, that restriction is part of the file’s own ACL, so Robocopy /COPYALL copies this restriction over to the new server as-is, too. Users will keep being unable to write on the new server even after the migration completes, so the final stage of the migration work needs to include, on its checklist, the task of explicitly lifting any read-only restriction that was set as an NTFS permission.

Common Misconceptions and Pitfalls

Troubleshooting Perspective

  1. Reports keep coming in that domain users can’t access the file server after migration: Check whether the new server was actually domain-joined at the time of migration, and whether the old server’s ACL used any local groups.
  2. A specific folder stays stuck non-writable even after migration: Check the old server’s ACL from before migration, for whether a read-only restriction was set as an NTFS permission.
  3. After migration, every access to the shared folder on the new server gets denied: Check whether share permissions were explicitly set when creating the share on the new server’s side. Even with correct NTFS permissions, access gets denied if share permissions were never configured.

Summary

Takeaways to Apply Today

  1. In a file server migration, always confirm “the new server’s domain join has completed” before running a Robocopy file copy.
  2. Early in migration planning, check whether the old file server’s ACL uses any local groups.

References

Comments

Feel free to leave thoughts, questions, or corrections below (sign in with a GitHub account to comment or react).