Symptoms
ShareGate Migrate displays one of the following error messages:
- The specified file or folder name is too long. The URL path for all files and folders must be 260 characters or less (and no more than 128 characters for any single file or folder name in the URL).
- The specified item name is too long. The name of the item cannot exceed the limit of 128 characters.
- The specified folder name is too long. The name of the folder cannot exceed the limit of 128 characters.
- The specified item name is too long. The name of the item cannot exceed the limit of 256 characters.
- The specified folder name is too long. The name of the folder cannot exceed the limit of 255 characters.
- The specified item name is too long. The server relative path of the item's parent folder cannot exceed the limit of 256 characters.
- The specified folder name is too long. The server relative path of the folder's parent folder cannot exceed the limit of 256 characters.
- The specified item name is too long. The server relative path of the item's parent folder cannot exceed the limit of 400 characters.
- The specified folder name is too long. The server relative path of the folder's parent folder cannot exceed the limit of 400 characters.
- The specified item name is too long. The server relative path of the item cannot exceed the limit of 260 characters.
- The specified folder name is too long. The server relative path of the folder cannot exceed the limit of 260 characters.
- The specified item name is too long. The server relative path of the item cannot exceed the limit of 255 characters.
- The specified folder name is too long. The server relative path of the folder cannot exceed the limit of 253 characters.
Or one of the following warning messages:
- The server relative path of the item exceeds 255 characters. The item will be copied, but you might experience unexpected behavior.
- The server relative path of the folder exceeds 255 characters. The folder will be copied, but you might experience unexpected behavior.
Error code
- IN-011-035
- IN-013-035
- IN-019-035
- IN-019-056
- IN-026-035
- AN-067-035
- IN-033-035
- IN-072-035
- IN-073-035
- IN-077-035
- IN-791-035
- IN-026-000
- IN-088-035
- IN-098-035
- IN-093-035
- IN-105-035
- AN-066-035
Details
SharePoint imposes a limit on the number of characters that a file or folder path can have. The limits are as follows:
Validated path |
SharePoint environment |
Maximum length |
Item or file name |
On-Premises |
128 |
Item or file name |
Microsoft 365/SharePoint 2019 (Insane Mode) |
400 |
Item or file name |
Microsoft 365/SharePoint 2019 (Normal Mode) |
400 |
Folder name |
On-Premises |
128 |
Folder name |
Microsoft 365/SharePoint 2019 (Insane Mode) |
400 |
Folder name |
Microsoft 365/SharePoint 2019 (Normal Mode) |
400 |
Document Set name |
On-Premises |
128 |
Document Set name - Content Type is not Folder |
Microsoft 365 |
255 |
Discussion Board title - Content Type is not Folder |
Microsoft 365 |
255 |
Parent folder path |
On-Premises |
256 |
Parent folder path |
Microsoft 365/SharePoint 2019 (Insane Mode) |
400 |
Parent folder path |
Microsoft 365/SharePoint 2019 (Normal Mode) |
400 |
Item full path |
On-Premises |
260 |
Item full path |
Microsoft 365/SharePoint 2019 (Insane Mode) |
400 |
Item full path |
Microsoft 365/SharePoint 2019 (Normal Mode) |
400 |
Folder full path |
Microsoft 365 (Insane Mode) on Create only |
255 |
When copying a file, list item, or folder that would exceed this limit, ShareGate Migrate signals an error indicating that the path is too long and that this element cannot be created in the destination SharePoint.
For example, a file was uploaded to a library in a SharePoint environment with the following URL:
http://myFarm/sites/mySite/mySubsite/myLibrary/myFolder/myParentFolder/myFile.txt
And the following values would be validated:
- File name: myFile.txt
- Note: If the uploaded item had been a folder, the limits relating to a folder would have been applied instead.
- Parent folder path : sites/mySite/mySubsite/myLibrary/myFolder/myParentFolder
- Item full path: sites/mySite/mySubsite/myLibrary/myFolder/myParentFolder/myFile.txt
Possibility of unexpected behavior
In certain cases, a warning indicating the possibility of unexpected behavior will be shown when the length of the item's full path exceeds 255 characters in SharePoint on-premises. The item will be copied, but you may experience issues when opening the file in SharePoint or when attempting to delete the item or folder.
Solution
If the issue is the length of the complete file path:
Copy to a lower level in the folder structure.
For example, if you are copying files to MyLibrary/SubFolder1/SubFolder2/... and so on (with many levels of sub-folders), create a new folder directly under MyLibrary, and copy your files inside it.
If the issue is the length of the file names:
Rename the source files with shorter names.
If the error occurs on an item when copying to a Microsoft 365 destination:
Rename the source files with shorter names or copy to a lower level in the folder structure.
It is important to note that the total length of a URL equals the length of the folder or file path, including the protocol name, server name, folder or file name, and any parameters that are included as part of the URL.
So total URL = protocol + server name + folder or file path + folder or file name + parameters.
For more information, see Microsoft's documentation on Naming Files, Paths, and Namespaces.
If you are unable to open or delete the item at the destination and you have received a warning during the copy indicating the possibility of unexpected behavior:
Rename the item or folder to a shorter name so its full path does not exceed 255 characters.
Once the path does not exceed this length, you should be able to use the item or folder normally.