How to fix “path too long” in a SharePoint migration
Updated October 2026 · 7 min read
What the limit actually is
Two limits bite during a SharePoint or OneDrive migration:
- ~400 characters for the entire decoded URL (site + library + folder path + file name).
- 255 characters for any single file or folder name.
Encoding makes it worse: spaces and special characters expand (a space becomes %20), so a path that looks under the limit on disk can cross it once SharePoint encodes it.
Why it works in Windows but fails in SharePoint
Modern Windows happily opens very deep paths — with the \\?\ prefix or long‑paths enabled, it goes well beyond the old 260‑character MAX_PATH. So the files sit there perfectly readable on the file server. SharePoint, though, enforces its URL‑length limit after encoding, so the identical deep path is refused at upload. That mismatch is why "it's fine on the server" and "it won't migrate" are both true at once.
How to find your long paths
Before you can fix them you need to know where they are. You can script this with PowerShell (enumerating the tree and measuring each full path), but on a large share that's slow and gives you a raw list with no plan. A good migration assessment should surface the longest paths, how many exceed the limit, and by how much — so you know the size of the job before you start.
The manual fixes — and why they hurt
- Rename deep folders to shorter names — but every rename risks breaking shortcuts, links and references.
- Flatten — move contents up a level to remove a tier — tedious and easy to get wrong across thousands of folders.
- Map a drive deeper into the tree to shorten the working path — a workaround, not a fix.
- Re‑scan and repeat until nothing exceeds the limit, then migrate.
On a real file server this is hours to days of careful, error‑prone work — and it's exactly the kind of task that gets rushed at the end of a migration window.
How Approdo fixes long paths automatically
- Survey — Approdo lists every over‑length path and name, plus illegal characters SharePoint won't accept, with the exact overage.
- Plan — it proposes truncations and flattening and shows you the before/after for each. You can edit any item or accept the lot.
- Remediate — it applies the plan on disk using long‑path‑safe APIs (the
\\?\prefix and .NET long‑path methods), so it can act on paths other tools can't even open. Every change is logged, with a full undo. - Migrate — the now‑compliant structure uploads cleanly via Microsoft's Migration API, with metadata and permissions intact.
Truncate vs flatten
Truncating shortens over‑long names; flattening removes an unnecessary folder tier by lifting its contents up. Approdo chooses the least‑disruptive option per path and shows you the result, so the structure stays sensible rather than mangled.
Keeping links intact
Because every rename and move is recorded, Approdo keeps a map of old → new locations — useful for updating shortcuts and for the audit trail, and reversible if you change your mind before cutover.
Approdo is coming soon
Approdo's free assessment lists every over‑length path and shows exactly how it'll fix them.
Register your interest →FAQ
What is the SharePoint path length limit?
About 400 characters for the full decoded URL, and 255 for any single name. Encoding (e.g. spaces → %20) can push a path over even when it looks fine on disk.
Can I just enable long paths in Windows to fix it?
That helps Windows handle the files, but it doesn't help SharePoint — SharePoint's URL limit still applies. You have to shorten or flatten the structure before upload.
Will fixing paths break my links?
It can if done carelessly. Approdo records every change as a reversible old → new map, so you can update references and roll back if needed.