What Goes Wrong When You Move a File Server to SharePoint and OneDrive ── Path Length, Blocked Names, Excel Links, Macros and Access
· Go Komura · SharePoint, OneDrive, Microsoft 365, File Server, Migration, Excel, Access, IT Administration
Revision history (first version, published Nov 1, 2026)
- First published
Cite this article(DOI: 10.5281/zenodo.23856514)
This article is archived on Zenodo. Below are both the DOI that always resolves to the latest version and the DOI pinned to the version you are reading.
Go Komura (2026). What Goes Wrong When You Move a File Server to SharePoint and OneDrive ── Path Length, Blocked Names, Excel Links, Macros and Access. KomuraSoft LLC. https://doi.org/10.5281/zenodo.23856514 https://comcomponent.com/en/blog/file-server-to-sharepoint-migration-pitfalls/
- DOI (latest version)
- 10.5281/zenodo.23856514
- DOI (this version)
- 10.5281/zenodo.23856515
When you move an in-house file server to SharePoint or OneDrive, you may run into problems such as files that were moved but will not open, Excel figures that no longer update, and macros that stop working. Most of the causes can be known before the migration: path length and blocked names, workbooks and macros that assume particular paths, files such as Access databases that care where they are stored, and the way permissions carry over.
This article arranges these problems in the order in which you find and fix them before migrating. The short answer: scan names and paths before moving anything, list everything that references paths, separate out files such as Access databases that are better not opened from SharePoint, and then try a small scope before moving the rest.
The scenario is moving from a Windows file server (shared folders) to SharePoint Online document libraries or OneDrive. The limits and behavior described were checked against Microsoft’s documentation as of November 2026; they are not the results of trying a migration in a particular environment. The paths and site URLs in the article are examples for explanation.
Four Places Where Migration Runs into Problems
Problems in a migration fall broadly into the following four areas.
- File names and paths. SharePoint and OneDrive have length limits and blocked names that differ from those of a Windows file server.
- Things that assume paths. Links between Excel workbooks, macros, scripts and business applications keep the file server paths written in them.
- How files are shared. Microsoft recommends not opening Access databases from SharePoint. Simultaneous editing in Excel works differently on a file server and on SharePoint.
- Permissions. Not every permission on the file server carries over as it is.
flowchart TB
accTitle: Four places where a migration from a file server runs into problems
accDescr: Divides the places where migration problems arise into four: names and paths, things that assume paths, how files are shared, and permissions.
M["Migrating from a file server to SharePoint and OneDrive"]
M --> N["Names and paths"]
M --> R["Things that assume paths"]
M --> S["How files are shared"]
M --> P["Permissions"]
N -.-> N1["Length limits and blocked names"]
R -.-> R1["Links, macros and business apps"]
S -.-> S1["Access and simultaneous editing"]
P -.-> P1["Permissions that do and do not carry over"]
Figure 1: The places where migration problems arise can be divided into four: names and paths, things that assume paths, how files are shared, and permissions.
In the diagram a solid line marks a relation that always holds and a dashed line marks a conditional one (the conditions are given per relation on the detail page). The full list of relations (7 in total, with evidence and certainty) and the definitions of the main concepts are collected on the knowledge map detail page (in Japanese). Data: JSON-LD / Turtle
Path Length
The Limit in SharePoint and OneDrive Is 400 Characters
In SharePoint and OneDrive, the whole URL-decoded path, including the file name, can be up to 400 characters1. Microsoft’s migration tool, Migration Manager, counts the length including the tenant URL, the site, the path and character encoding, and reports anything over 400 characters2.
Destination paths start with https://(tenant name).sharepoint.com/sites/(site name)/Shared Documents/…, so if you look only at the length of the path on the file server (\\fileserver\share\Sales\…), you may underestimate it. If you move deep folders as they are, the destination URL can exceed the limit.
Synced PCs and Office Apps
The OneDrive sync app synchronizes OneDrive files and SharePoint document libraries to folders on a PC3. Even when a path fits within the SharePoint and OneDrive limits, another limit applies once you sync it to a PC. With the OneDrive sync app, a sync error occurs if the local path (up to 400 characters) plus the location of the OneDrive sync folder (up to 120 characters) exceeds 520 characters1.
The other one is the Office desktop apps. Word, PowerPoint and Excel on Windows cannot open files whose path exceeds 260 characters, even if they are stored locally. This is because the Office apps use older Win32 APIs that assume MAX_PATH (260). In addition, the Office desktop apps create a temporary lock file whose path is the original file’s path with characters added, so when a path is close to 260 characters, the lock file’s path can exceed the limit and cause errors when saving or opening1.
flowchart TB
accTitle: Path limits in SharePoint, sync and Office
accDescr: Shows three limits: 400 characters in SharePoint and OneDrive, 520 characters for the local path plus the sync folder location in the sync app, and 260 characters in the Office desktop apps on Windows.
F["Path of a migrated file"]
F --> A["SharePoint and OneDrive: 400 characters"]
F --> B["Sync app: 520 characters"]
F --> C["Office desktop apps: 260 characters"]
A -.-> A1["The whole path after URL decoding"]
B -.-> B1["Local path plus the sync folder"]
C -.-> C1["The lock file's path is longer still"]
Figure 2: The cloud, the sync app and the Office apps each have a different path length limit.
In practice you end up reviewing folder depth and name length against the strictest one, Office’s 260 characters. Microsoft also recommends shortening names, reducing nesting, and keeping frequently used files higher in the hierarchy1. The 260-character limit on Windows paths itself is covered in detail in “MAX_PATH and Windows Path/Filename Pitfalls”.
Blocked Characters and Names
SharePoint and OneDrive do not allow the following characters and names4.
| Kind | Details |
|---|---|
| Characters | " * : < > ? / \ \| |
| Leading and trailing spaces | Spaces at the start and end of a name |
| Names | .lock, CON, PRN, AUX, NUL, COM0–COM9, LPT0–LPT9, desktop.ini |
| Parts of names | Names containing _vti_, names starting with ~$ |
| Top level of a library | A file or folder named forms |
Of these, the characters in the first row and reserved names such as CON and COM1 cannot be used in Windows file names either5. So when you migrate from a Windows file server, the rows you mainly need to check are the rest: names with a leading space, names starting with ~$, and desktop.ini, for example. desktop.ini is a file placed in a folder to change that folder’s icon or display6.
flowchart TB
accTitle: Blocked names seen from their differences with Windows
accDescr: Blocked characters and reserved names are also invalid on Windows, so they rarely appear in the source; leading or trailing spaces, names starting with tilde and dollar, desktop.ini, _vti_ and forms at the top of a library can exist on a file server and are what to check.
X["Names not allowed in SharePoint and OneDrive"]
X --> W["Also not allowed on Windows"]
X --> O["Allowed on Windows"]
W -.-> W1["Blocked characters and reserved names such as CON"]
O -.-> O1["Leading spaces and names starting with ~$"]
O -.-> O2["desktop.ini, _vti_ and forms at the top level"]
Figure 3: Names that Windows also forbids hardly exist in the source, so focus the check on names that Windows allows.
In Migration Manager, a folder with a blocked name is reported in the scan as “Scan file failure: The folder name is invalid”, and a file name containing blocked characters fails the migration with error 0x011100107.
Limits on Counts, Size and Number of Permissions
Besides names and paths, the following limits apply4.
- A single file can be up to 250 GB.
- It is recommended to keep the total number of synced files and folders within 300,000. Beyond that, performance may degrade even if you are not syncing everything.
- The supported limit for items with unique permissions is 50,000, and in general keeping it within 5,000 is recommended.
flowchart TB
accTitle: Limits on counts, size and number of permissions
accDescr: Shows three limits: up to 250 GB per file, 300,000 synced items recommended at most, and up to 50,000 items with unique permissions supported with 5,000 or fewer recommended.
L["Limits other than names and paths"]
L --> S["Up to 250 GB per file"]
L --> Y["Sync: 300,000 items in total recommended at most"]
L --> U["Unique permissions: up to 50,000 items"]
U -.-> U1["5,000 or fewer recommended in general"]
Figure 4: File size, the number of synced items, and the number of unique permissions also have limits.
If you set fine-grained permissions folder by folder on the file server, you end up with many items with unique permissions at the destination. Migration Manager also has an error for too many unique permissions (0x02030003) and asks you to simplify the permission list7.
Things That Assume Paths
Moved files can no longer be opened with file server paths such as \\fileserver\share\… or drive-letter paths such as Z:\…. Anything that has such a path written inside it has to be fixed along with the migration.
Links Between Excel Workbooks
An Excel workbook that references cells in other workbooks holds links to those source workbooks. If a source is moved or deleted, the link breaks8.
You can list the links in the “Workbook Links” pane, opened from “Queries & Connections” on the Data tab. After moving a source, use “Change source” in the same pane to select the workbook at its new location. “Break link” replaces the formulas that depend on the source with their current values. In the desktop version of Excel this cannot be undone, so save a backup of the workbook before breaking links8.
flowchart TB
accTitle: Fixing Excel workbook links for a migration
accDescr: Before migrating, list the sources in the Workbook Links pane; after moving the sources, choose the new location with Change source; if breaking links, take a backup first.
A["Before migrating: list sources in the Workbook Links pane"] --> B["Move the source workbooks"]
B --> C["Choose the new location with Change source"]
B -.-> D["If breaking links, take a backup first"]
Figure 5: List the sources before migrating, and choose them again with Change source after moving.
In Excel for the web, links to workbooks in a different domain cannot be refreshed. This includes links across tenants and links to other regions; you have to refresh them in the desktop version8.
Paths Written in Macros, Scripts and Business Applications
VBA macros, batch files, PowerShell scripts and in-house business applications sometimes have paths such as \\fileserver\share\… or Z:\… written directly in them. These keep trying to open the same paths after migration, so before migrating, find every place where paths are written and decide what each should reference afterwards.
How you decide the new reference depends on whether you read the files through the path on a synced PC, read them through the SharePoint API, or leave them on the file server. A file on a synced PC may exist only in the cloud, which can cause problems for a business application built on the assumption that the file is local. This is covered in “OneDrive Files On-Demand and Business Apps”. Points to watch when a service or another user reads a file server are covered in “Pitfalls of Network Drives and UNC Paths”, and deciding whether to replace Excel macros with Power Automate and similar tools in “Migrating Excel VBA Macros to Power Automate”.
Access Databases
Microsoft recommends that, although you can save Access databases to OneDrive or a SharePoint document library, you avoid opening them from there. The recommendation applies to single-file databases, to split databases, and to the .accdb, .accdc, .accde and .accdr formats9.
flowchart TB
accTitle: How to handle Access databases in a migration
accDescr: Access databases, including split databases and every format, should not be opened from OneDrive or SharePoint libraries, so they are separated from the migration scope and their location and design are considered separately.
A["Access databases (.accdb, .accde, etc.)"] --> B["Avoid opening them from SharePoint or OneDrive"]
B --> C["Separate them from the migration scope"]
C --> D["Consider their location and design separately"]
Figure 6: Do not move Access databases together with other files; decide how to handle them separately.
An Access application used by several people on the file server should not be moved together with the other files; separate it from the migration scope. Then consider options such as moving the data to SQL Server or rebuilding the application. How to choose is covered in “Extending the Life of and Migrating VB6 / Access Business Apps”.
Differences in Simultaneous Editing
When someone has an Excel workbook on a file server open, nobody else can edit it. A workbook stored in SharePoint or OneDrive can be edited by several people at once (co-authoring) when the conditions are met. The conditions are as follows10.
- The workbook is in OneDrive, OneDrive for Business or SharePoint in Microsoft 365. Server paths such as
\\server\folderare not supported. - The format is
.xlsx,.xlsmor.xlsb. The Strict Open XML format is not supported. - The legacy “shared workbook” feature is turned off.
- Everyone uses a version of Excel that supports co-authoring. Excel 2016, 2019 and 2021 LTSC do not support co-authoring. If even one person opens the workbook in an unsupported version, everyone else sees it as “locked.”
flowchart TB
accTitle: Conditions for co-authoring in Excel
accDescr: Co-authoring works when the workbook is in OneDrive or SharePoint in Microsoft 365, is in xlsx, xlsm or xlsb format, has the shared workbook feature turned off and is opened in a supporting Excel; if even one person opens it in an unsupported version, others see it as locked.
A["Workbook in SharePoint or OneDrive"] --> B["Is the format xlsx, xlsm or xlsb?"]
B --> C["Is the shared workbook feature off?"]
C --> D["Does everyone use an Excel that supports co-authoring?"]
D -->|"Yes"| E["Simultaneous editing works"]
D -->|"Even one does not"| F["Others see it as locked"]
Figure 7: Co-authoring works when the location, format, shared workbook setting and Excel version all line up.
If you check, before migrating, which versions of Excel are in use and which workbooks use the shared workbook feature, you can reduce post-migration inquiries along the lines of “it’s locked and I can’t open it.”
How Permissions Carry Over
Microsoft’s SharePoint Migration Tool (SPMT) is a free tool that moves content such as file shares to SharePoint and OneDrive11. With SPMT, how file server permissions carry over depends on whether users are mapped12.
- When source users are mapped to Microsoft 365 users, for example by syncing on-premises Active Directory accounts to Microsoft Entra ID, permissions carry over.
- Three kinds carry over: Read, Write and Full Control. Read becomes “Read”, Write becomes “Contribute”, and Full Control becomes “Full Control.”
- Special permissions such as Deny do not carry over.
- If users are not mapped, the destination’s default permissions apply.
flowchart TB
accTitle: How permissions carry over with the SharePoint Migration Tool
accDescr: If users are mapped, Read carries over as Read, Write as Contribute and Full Control as Full Control; special permissions such as Deny do not carry over; if users are not mapped, the destination's default permissions apply.
U["Are source users mapped to Microsoft 365 users?"]
U -->|"Mapped"| M["Three kinds of permissions carry over"]
U -->|"Not mapped"| D["The destination's default permissions"]
U -.-> X["Special permissions such as Deny do not carry over"]
M --> R["Read → Read"]
M --> W["Write → Contribute"]
M --> F["Full Control → Full Control"]
Figure 8: If users are mapped, three kinds of permissions carry over, but Deny does not.
Folders hidden from particular people with Deny permissions may become visible after migration. Before migrating, list the file server’s permissions and check where Deny is used and where permissions are split finely folder by folder. How to list permissions is covered in “Taking Inventory of a File Server with PowerShell”. If you consolidate permissions at the site or library level at the destination, you also keep down the number of unique permissions discussed in the earlier section.
Finding Problems Before Migrating
Migration Manager’s Scan
Migration Manager is used from the Migration center in the SharePoint admin center7. When you add a source, it automatically scans every file under the root. The results show the number of files and folders, the maximum path length, the number of permission entries on the root folder, and the migration readiness. A readiness of “Warning” means there are problems such as invalid characters or folders that cannot be read. You can download an overall summary and a scan log listing every file2.
Listing Candidates with PowerShell
If you want a rough idea locally before scanning, you can list candidates with PowerShell. The following script is an example for explanation. It writes to a CSV the items whose path, with the destination URL prefixed, exceeds 400 characters, and the items containing blocked characters or names. It assumes PowerShell 7, so check its behavior on a small folder before you actually use it. I ran this script with PowerShell 7.6 against a test folder containing, separately, items that meet each condition (blocked characters, reserved names, blocked names, leading and trailing spaces, length) and confirmed that only the matching items were written out. I tested it on folders on Linux, not on UNC paths of a Windows file server.
param(
[Parameter(Mandatory)] [string] $Root, # e.g. \\fileserver\share\Sales
[Parameter(Mandatory)] [string] $TargetUrl, # e.g. https://contoso.sharepoint.com/sites/sales/Shared Documents
[int] $Limit = 400,
[string] $OutFile = '.\migration-precheck.csv'
)
$badChars = '["*:<>?/\\|]'
$reserved = '^(CON|PRN|AUX|NUL|COM[0-9]|LPT[0-9])(\..*)?$'
$blocked = '^(\.lock|desktop\.ini)$|^~\$|_vti_'
Get-ChildItem -LiteralPath $Root -Recurse -Force -ErrorAction SilentlyContinue |
ForEach-Object {
$relative = $_.FullName.Substring($Root.Length).TrimStart('\', '/') -replace '\\', '/'
$target = "$TargetUrl/$relative"
$reasons = @()
if ($target.Length -gt $Limit) { $reasons += "length $($target.Length)" }
if ($_.Name -match $badChars) { $reasons += 'character' }
if ($_.Name -match $reserved) { $reasons += 'reserved name' }
if ($_.Name -match $blocked) { $reasons += 'blocked name' }
if ($_.Name -ne $_.Name.Trim()) { $reasons += 'leading or trailing space' }
if ($reasons) {
[pscustomobject]@{ Path = $_.FullName; Length = $target.Length; Reasons = $reasons -join ', ' }
}
} |
Export-Csv -Path $OutFile -NoTypeInformation -Encoding utf8
The length is the number of characters in the destination URL joined with the relative path, and it may not match the way Migration Manager counts. Use the results of the Migration Manager scan for the final decision. This script does not check for forms at the top level of a library.
Migrating in Stages
Carry out the checks described so far in the following order.
- List the source. Use a Migration Manager scan or similar to check path lengths, blocked names, the number of files and the number of permissions.
- Fix names and paths. Shorten long paths by shortening names or flattening the hierarchy. Rename items with blocked names.
- List the things that assume paths. Write down the paths in workbook links, macros, scripts and business application settings, along with Access files, and decide how each will be handled after migration.
- Try a small folder. After moving it, check that files open, that links can be pointed at the new location, and that permissions are as intended.
- Move the rest. Users can keep using the file server during this step.
- Make the original folders on the file server read-only.
- Run the same migration task again to move files that were updated or added since the previous run. On the second and later runs, Migration Manager skips files that were already migrated and have not changed, and moves only updated and new files13.
- Switch over. After confirming that files open at the destination, tell users about the new location.
Making the source read-only first and then moving the final changes ensures that you do not miss files edited in the original folders after step 5. If a file has been updated in both the source and the destination and the destination copy is newer, the change in the source is not moved even by the incremental migration13.
flowchart TB
accTitle: Steps for a staged migration from a file server
accDescr: Proceed in this order: list and scan the source, fix names and paths, list things that assume paths, try a small folder, move the rest, make the original folders read-only, move the changes, then verify and notify users.
A["1. List and scan the source"] --> B["2. Fix names and paths"]
B --> C["3. List the things that assume paths"]
C --> D["4. Try a small folder"]
D --> E["5. Move the rest"]
E --> F["6. Make the original folders read-only"]
F --> G["7. Move the changes again"]
G --> H["8. Verify and notify users"]
Figure 9: Finish checking and fixing first, try something small before moving the rest, then stop writes, move the changes and switch over.
This order is the article’s proposal based on the documentation. The scope of the trial and the timing of the switchover vary with the size of the company and how files are used.
Related Articles
- MAX_PATH and Windows Path/Filename Pitfalls
- OneDrive Files On-Demand and Business Apps
- Pitfalls of Network Drives and UNC Paths
- Replacing an Excel Ledger with a SharePoint List
- Extending the Life of and Migrating VB6 / Access Business Apps
- Migrating Excel VBA Macros to Power Automate
References
-
Microsoft Support, What are the file path length limits?. The 400-character limit in OneDrive and SharePoint, the 520-character limit in the sync app, the 260-character limit in the Office desktop apps on Windows, the effect of lock files, and ways to shorten paths. ↩ ↩2 ↩3 ↩4
-
Microsoft Learn, Migration Manager scan. What the scan covers, the columns in its report, how path length is counted, and downloading the logs. ↩ ↩2
-
Microsoft Support, Sync SharePoint and Teams files with your computer. How to sync SharePoint and Teams files to a folder on a PC with the OneDrive sync app. ↩
-
Microsoft Support, Restrictions and limitations in OneDrive and SharePoint. Blocked characters and names, and limits on file size, the number of synced items and the number of unique permissions. ↩ ↩2
-
Microsoft Learn, Naming Files, Paths, and Namespaces. Characters and reserved names that cannot be used in Windows file names. ↩
-
Microsoft Learn, How to Customize Folders with Desktop.ini. How to change a folder’s icon and display with desktop.ini. ↩
-
Microsoft Learn, Troubleshoot Migration Manager. Where the Migration center is in the SharePoint admin center, and errors about blocked names, paths that are too long, invalid characters and too many unique permissions. ↩ ↩2 ↩3
-
Microsoft Support, Manage workbook links. The Workbook Links pane, Change source, Break link, and cross-domain links in Excel for the web. ↩ ↩2 ↩3
-
Microsoft Support, Excel file is locked for editing. The location, format, shared workbook setting and Excel version required for co-authoring. ↩
-
Microsoft Learn, SharePoint Migration Tool for SharePoint and OneDrive. An overview of SPMT and the file shares it can use as a source. ↩
-
Microsoft Learn, File and folder permissions when using the SharePoint Migration Tool. User mapping, which permissions carry over and how they map, and the fact that Deny does not carry over. ↩
-
Microsoft Learn, Delta Sync. On the second and later migration runs (incremental migration), files already migrated and unchanged are skipped and updated and new files are moved; a file updated in both the source and the destination is not moved if the destination copy is newer. ↩ ↩2
Related Articles
Recent articles sharing the same tags. Deepen your understanding with closely related topics.
Replacing an Excel Ledger with a SharePoint List — Sharing, History, and Flow Integration to Put an End to the Broken Ledger
A practical guide to migrating an Excel ledger on a shared folder to a SharePoint list (Microsoft Lists). Covers solving concurrent editi...
Building an Intake for Internal Requests with Microsoft Forms — Consolidating Email and Verbal Requests into a Form
A practical guide to consolidating the email and verbal requests that land on IT, general affairs, and accounting into Microsoft Forms. C...
Designing Scheduled Flows in Power Automate — Month-End Processing, Business-Day Checks, and Reminders in Practice
A practical guide to automating recurring processes with Power Automate's Recurrence trigger. Covers the trap of the default time zone be...
Building an Approval Workflow in Power Automate — Digitizing Paper and Email-Based Approval Requests
A practical guide to digitizing paper approval forms and email-attached Excel requests with Power Automate: the types of approval actions...
Migrating Excel VBA Macros to Power Automate — What to Replace with Office Scripts, and What to Leave as VBA
A guide to whether Excel VBA macros can migrate to Power Automate, covering what Office Scripts can replace, what only VBA can still do, ...
Related Topics
These are topic pages close to this theme. Starting from the article, you can go on to related services and other articles.
Windows Technical Topics
Entry point collecting technical topics on Windows development, bug investigation, and use of existing assets.
Services Connected to This Topic
This article leads to the following service pages. Start from the entry point closest to your situation.
Technical Consulting & Design Review
You can consult us from the stage of deciding which files to move to SharePoint, which systems to keep, and in what order to migrate.
Modification & Maintenance of Existing Windows Software
We can take on fixing macros and business applications that assume file server paths so that they work with the new storage location after migration.
Frequently Asked Questions
Questions commonly asked at the time of consultation about the topic of this article.
- How many characters can a path have in SharePoint and OneDrive?
- According to Microsoft's documentation, the whole URL-decoded path, including the file name, can be up to 400 characters. When you sync to a PC, the length of the sync folder's location is added as well. Office desktop apps on Windows cannot open files whose path exceeds 260 characters.
- Is it all right to put an Access database on SharePoint and share it?
- Microsoft recommends that, although you can save Access databases to OneDrive or a SharePoint document library, you avoid opening them from there. This also applies to split databases and to formats such as .accde. For an Access application used by many people, consider a different location or design before migrating.
- Do the file server's permissions carry over as they are?
- With the SharePoint Migration Tool, Read, Write and Full Control permissions carry over when users in the source are mapped to users in Microsoft 365. Special permissions such as Deny do not carry over. If users are not mapped, the destination's default permissions apply.
- What should I examine before migrating?
- Examine path lengths, blocked names, links between Excel workbooks, paths written into macros and business applications, Access files, and the number of permissions. Microsoft's Migration Manager can report warnings about path length and invalid characters in its scan.
Author Profile
Profile page for the article author.
Go Komura
Representative of KomuraSoft LLC
Focused on Windows software development, technical consulting, and bug investigation, with particular strength in projects where existing assets remain and in investigating failures whose cause is hard to see.