How to fix “path too long” in a SharePoint migration
Updated October 2026 · 7 min read
What the limit actually is
Microsoft's SharePoint limits page gives the path limit as 400 characters for the entire decoded file path, including the file name. The folder path and the file name are counted together, after decoding.
It is the path at the destination that counts: Microsoft's page on Migration Manager lists files whose destination path is longer than 400 characters among those that are not migrated.
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, holds the whole file path to 400 characters, 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 will fix long paths
- Survey — Approdo lists every over‑length path and name, plus illegal characters SharePoint won't accept, with the exact overage.
- Plan — it proposes shorter names and shows you the before/after for each. You can edit any item, and nothing is applied until you approve the plan. A dry run shows what would be left behind, and why.
- Remediate — it applies the plan you approved. It reaches the files through long‑path‑safe APIs (the
\\?\prefix and .NET long‑path methods), the way Windows itself opens paths longer than 260 characters. Every rename is logged. - Migrate — the files upload under the names in the plan you approved, through Microsoft's own interfaces.
Shorten, not flatten
Truncating shortens over‑long names; flattening removes an unnecessary folder tier by lifting its contents up. Flattening removes folders and cannot be undone, so Approdo will not flatten. It will propose shorter names only, and show you each one before anything is renamed.
Keeping track of links
Because every rename is logged, Approdo will keep a map of old → new names — useful for updating shortcuts and for the audit trail.
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?
Microsoft's published limit is 400 characters for the entire decoded file path, including the file name. Microsoft's page on Migration Manager lists files whose destination path is longer than 400 characters among those that are not migrated.
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 400‑character limit on the file path still applies. You have to shorten or flatten the structure before upload.
Will fixing paths break my links?
It can if done carelessly. Approdo will log every rename as an old → new map, so you can update references, and nothing is renamed until you approve the plan.