One or more files in the restored site collection will exceed the maximum supported path length. Please select a shorter destination site address and try again.

I had a customer encounter an error while trying to restore a site collection using STSADM -O RESTORE.   They had backed up the site collection without error from the same farm, but when they tried to restore the site collection using a new URL to the same farm, STSADM gave them the following error:

One or more files in the restored site collection will exceed the maximum supported path length. Please select a shorter destination site address and try again.

After some investigation I found out, as the error message alludes to, the path we are trying to restore to is violating the 260 character path length restriction in SharePoint.  There are a few tables in the database that can trigger a violation of the path length, in our case it was in the docs table.  In our scenario, the original URL was sites/abc.  In this site collection, we have a document library with a nested folder structure, the longest folder path being 259 characters, just under the 260 limit.  The URL we used to restore the site collection backup to was sites/abcxyz, three characters longer than the original URL.  These extra three characters made our 259 character folder path in the original URL, 262 characters, which is over the 260 character limit, causing the error to be thrown.

To understand the root of the problem, I kept digging and finally tracked the error down to the proc_RenameSite stored procedure, which is called AFTER the process restores all the content to the content database.  The bad part about the AFTER statement, is that if you have a large site collection (10’s of GBs), you will likely be waiting a several hours for the restore process to reach this point in the process, have it error out and roll back the restore and exit, leaving you in a very “happy” mood. 

You have a couple courses of action to work around this problem.  The easiest, but not always practical, method is to shorten the name of the site collection you are restoring, something like sites/sweng instead of sites/software_engineering, giving you 15 extra characters in your folder paths.  Second, if you still have the original site collection available, you could rename some folders, files, etc, to shrink the URL length well below the 260 character limit, so you have the extra characters available for your restored site URL.  Finally, if you do not have the original site collection available to you, and you cannot choose a shorter URL for your restored site, you could run the restore processing again, choosing a temporary short site collection URL, like sites/x, rename some of the longer paths in your site collection, backup the sites/x site collection, and try the restore again using your desired URL.  It’s not a pretty or easy method, but it may be your only solution.

Here is a bit of SQL that you can use to examine your DOCS table in the content database, to look for long paths.  The Total column is the combination that cannot exceed 260 characters.

    LEN(DirName + N’/' + LeafName) AS Total, 
    Docs WITH (NOLOCK)

Comments (6)

  1. says:

    Interesting issue. I liked your cool SQL solution. Based on that idea I developed a new tool that we can use to check and correct the file path sizes using safe SharePoint API only (no SQL or ADO.NET).

    I hope you can review it and find it useful.I already made some tests with this tool on my company’s WSS 3.0 servers (and on my test virtual server ofcourse), it showed no problems 🙂

    I will be glad to get more specialists reviews about it, check the URL please:

  2. Salvador Moraes says:

    This SELECT has really helped me in one or two projects where needed to do a restore of a MOSS.

    Thanks for sharing.…/default.aspx

  3. Phil Shisbey says:

    Thanks! Following your advice the site restored with no issues.

  4. om prakash joshi says:

    dear sir i am install program but i see erorr "please select destination path again"

    how to instal program

  5. dreamibr81 says:

    Hi 'om prakash joshi'..

    If you are still looking for the program, then you can download it from here…/SharePoint%20File%20Path%20Checking%20Utility.exe

    Notice this is tested only for SharePoint 2007, and you should run it from the SharePoint server machine.

    here is a screenshot:…/App.JPG


Skip to main content