Call4Cloud | MMP-C | Autopilot | Device Preparation

The Grand OneDrive Path is Too Long Hotel

Patch My Pc | install & update thousands of apps

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?

The data area passed to a system call is too small

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.

path is too long error will be shown in microsoft onedrive when we want to sync the item

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}

checking all folders with a powershell script to detect if a folder has more than 259 characters

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!

longpathsenabled configured to 1 doesnt solve the path is too long error we received in onedrive when syncing the data

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.

creating a shortcut for onedrive from sharepoint

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 that could easily detect if the path is too long.

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!

12 thoughts on “The Grand OneDrive Path is Too Long Hotel

  1. Thank you for sharing these tips. However, I have been using the Long Path Tool, it is super easy for migrating files.

    1. Hehehe… yep, we are indeed using the same tool .. (blog is a little bit becomming out dated it seems 🙂 )

    1. Finally some sane comments on the post and suggestions about tool are also welcomed. On my way to download LongPath Tool.

      1. The blog was a bit overdue.. 🙂 … needed to update it a bit… but yeah the long path tool is a lifesaves

  2. I needed reviews for Longpath tool, but after reading comments, I’d just install it directly.

Leave a Reply

Your email address will not be published. Required fields are marked *

77  −  73  =  

Proudly powered by WordPress | Theme: Wanderz Blog by Crimson Themes.