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.
SELECT
LEN(DirName + N’/' + LeafName) AS Total,
DirName,
LeafName
FROM
Docs WITH (NOLOCK)
ORDER BY Total DESC
Comments
Anonymous
May 28, 2009
PingBack from http://microsoft-sharepoint.simplynetdev.com/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/Anonymous
February 10, 2010
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: http://www.4shared.com/file/155141906/b994192a/Sharepoint_file_path_checking_.htmlAnonymous
October 22, 2010
This SELECT has really helped me in one or two projects where needed to do a restore of a MOSS. Thanks for sharing. www.canalsharepoint.com.br/.../default.aspxAnonymous
November 08, 2010
Thanks! Following your advice the site restored with no issues.Anonymous
July 24, 2014
dear sir i am install program but i see erorr "please select destination path again" how to instal programAnonymous
September 15, 2014
Hi 'om prakash joshi'.. If you are still looking for the program, then you can download it from here www.dropbox.com/.../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: www.dropbox.com/.../App.JPG :)