Migrating your file shares to OneDrive may seem like a simple process—pick a source, choose a destination, and hit go. But as many users find out, this approach can hit roadblocks, especially with file path length limits. One key issue that can grind productivity to a halt is the notorious “Path is Too Long” error, which OneDrive and Windows still enforce. These limitations, especially on complex, deeply nested folder structures and long file names, can lead to sync failures, inaccessible files, and a less-than-ideal experience for end users.
In this blog, I’ll address these known limitations and explore practical ways to tackle them, from restructuring data in Teams to leveraging tools like the Long Path Tool to keep your files accessible and your OneDrive experience running smoothly. Let’s dive in and ensure your migration is more than just a file move—it’s a full transformation.
1. Introduction
In a previous blog, I shared why OneDrive is such a powerful tool. But when it comes to migrating legacy file shares, simply picking a source and destination in the migration tool and hitting “start” isn’t always the best approach. You might wonder why.
Here’s a common scenario: your end users may want to sync their team sites to OneDrive. In Teams, it’s as easy as pressing the “synchronize” button to link the team site to OneDrive. However, this simple step can lead to unexpected issues without careful planning, especially when dealing with complex file structures or long file paths.
But what will you do when your end users have a complex and deep folder structure? Besides the complex file structure, what will happen when you stumble upon files with too many characters?
As shown above, we will run into the: The data area passed to a system call is too small error when we want to open such files.
Besides explorer.exe erroring out, if we somehow manage to get a long file in OneDrive, OneDrive will not be able to sync the item. As shown below, Microsoft OneDrive will tell us that we can’t sync this item because the path is too long.
Your users cannot open files in the OneDrive client larger than 259 characters. A simple method to check for files larger than 258 characters would be running this command.
Cmd /c dir /s /b |? {$_.length -gt 258}
By default, Windows uses a path length limitation (MAX_PATH); you can’t create or open files larger than 259 characters.
2. Can we fix the Path is Too Long error?
Could we try changing the longpathsenabled registry key to fix the path is too long error? It seems that changing the longpathsenabled to 1 will not help!
We have seen an excellent example of why 1-on-1 migrating your on-premise folder structure to Teams/SharePoint will not work.
You must transform your old on-premise folder structure to a new Microsoft Teams structure. Try not to use the general channel but create new channels (or private channels, when not everyone needs file access to that particular folder/channel in the team).
Every folder that needs to be migrated has to be checked. You don’t want more than 300k files synced if you are attached to some good performance.
But what should you do if you have already migrated your data to SharePoint without transforming it to a less deep folder structure?
3. Using Shortcuts
When you look at the file path, you will notice it also has the Company name. So, if you used a long company name, you must change it before you sync the team’s site to OneDrive. I guess changing the username to only one letter is not preferred.
A better new method is using shortcuts for your OneDrive and giving it a proper name. (you will need to stop syncing the team site in Onedrive first)
After you have stopped the sync, it’s best practice to kill/close the OneDrive Client app first and remove that folder (to be sure you don’t end up with 2 of the same folders from which one isn’t being updated anymore)
We have removed the old folder, started the OneDrive client, and browsed the SharePoint site from which you want to create a shortcut. Click on the icon I am showing below to start creating the shortcut.
After a minute or two, it all arrives in your Microsoft OneDrive folder. You can rename the shortcut to give it a better name.
As you will see below, adding only a particular subfolder to OneDrive will resolve the issue, unlike adding the whole team.
And that’s not the only benefit of using this option. When you use OneDrive on your mobile phone, you will notice that a shortcut has also been added to it. It is a very clear view, and you can ensure you can still access it even offline. Isn’t that great?
But I am not done yet because even when using wonderful OneDrive shortcuts instead of syncing the whole folder structure, we need to look at a perfect tool that will help you fix the long file names!
4. Long Path Tool
We use the Long Path Tool in every migration. With a few clicks, you can find out which files exceed the maximum of 255 characters. This tool can handle long-path files with more than 255 characters, offering fast scanning and the ability to copy multiple folders simultaneously.
Long Path Tool 5 – advanced long path files manager
This tool will save you a lot of time as it scans quickly and will come up with a good summary.
Conclusion:
If you want to move to a modern workplace and start collaborating, you must move and transform your data to SharePoint/Teams and OneDrive.
Before the migration, please be aware that there are many limitations. One of them is the maximum 260 characters in the OneDrive client. You don’t want to run away from the Limitations; accept them and deal with them!!
Please avoid using a long company name and run the long path tool!
Thank you for sharing these tips. However, I have been using the Long Path Tool, it is super easy for migrating files.
Hehehe… yep, we are indeed using the same tool .. (blog is a little bit becomming out dated it seems ๐ )
I totally agree. Long Path Tool has saved my life too.
Longpath files are too irritating, I use Longpath tool for them.
Long Path Tool has made my life easier.
Finally some sane comments on the post and suggestions about tool are also welcomed. On my way to download LongPath Tool.
The blog was a bit overdue.. ๐ … needed to update it a bit… but yeah the long path tool is a lifesaves
Hey, has anyone used LongPath Tool?
I came here to ask for the reviews but I think LPT is a life savor so I am gonna buy it.
Oh, everyone is using the same tool. Guess, I am on the right track. LPT foreover.
Oh yes, longpath tool is as effective as this blog.
I needed reviews for Longpath tool, but after reading comments, I’d just install it directly.