Monday, July 18, 2016

Cannot rename old site on restore


Some of us may face this "Cannot rename old site on restore" error while restoring Site in SharePoint. There may several reason to get this type of error. I am going to say about one of the reason to get this error. 

That's Long URL problem with Libraries and List attachments. Some of the URL can't be restored due to long URL. Here is the steps to find those long URL items.

  • Open the Content Database in SQL
  • Right click the DB and select New Query
  • Paste the below query
    SELECT
   CONCAT([DirName], N'/', [LeafName]) AS [FullRelativePath],
   LEN(CONCAT([DirName], N'/', [LeafName])) AS [Length]
    FROM
   [dbo].[AllDocs]
    ORDER BY
    [Length] DESC

  • We will get the Long URL Libraries and List items
  • Then go to that library / list
  • Delete the Library / List from site. It will be in Recycle bin. No need to worry about that
  • Then take new backup of your site and try to restore it
  • Restore the deleted library / list from recycle bin once site has been restored successfully

No comments:

Post a Comment