Problem Description:
when restoring a SPSite from a backup to a new URL (longer), it didn’t work.
Cause: for the new URL there would have been documents exceeding the 256 character URL limit
Resolution:
detach SQL database
find documents
re-attach and manually correct them
USE SPC_Content_MyShared_01
declare @siteid as UniqueIdentifier
set @siteid = ‘1cc13ce’
select *
FROM
TVF_AllDocs_Site(@siteID)
WHERE
LEN(CASE WHEN (DATALENGTH(DirName) = 0) THEN LeafName WHEN (DATALENGTH(LeafName) = 0) THEN DirName ELSE DirName + N’/’ + LeafName END) > 256