{"id":69,"date":"2017-10-08T09:40:58","date_gmt":"2017-10-08T09:40:58","guid":{"rendered":"http:\/\/4us2use.at\/?p=69"},"modified":"2018-03-09T12:16:46","modified_gmt":"2018-03-09T12:16:46","slug":"cannot-rename-spsite-on-restore-restore-spsite","status":"publish","type":"post","link":"http:\/\/4us2use.at\/?p=69","title":{"rendered":"Cannot rename SPSite on restore (Restore-SPSite)"},"content":{"rendered":"<p>Problem Description:<\/p>\n<p>when restoring a SPSite from a backup to a new URL (longer), it didn&#8217;t work.<\/p>\n<p>Cause: for the new URL there would have been documents exceeding the 256 character URL limit\u200b<\/p>\n<p>Resolution:<\/p>\n<p>detach SQL database<br \/>\nfind documents<br \/>\nre-attach and manually correct them<\/p>\n<p>USE SPC_Content_MyShared_01<br \/>\ndeclare @siteid as UniqueIdentifier<br \/>\nset @siteid = &#8216;1cc13ce\u2019<br \/>\nselect *<br \/>\nFROM<br \/>\nTVF_AllDocs_Site(@siteID)<br \/>\nWHERE<br \/>\nLEN(CASE WHEN (DATALENGTH(DirName) = 0) THEN LeafName WHEN (DATALENGTH(LeafName) = 0) THEN DirName ELSE DirName + N&#8217;\/&#8217; + LeafName END) &gt; 256<\/p>\n<span id=\"post-ratings-69\" class=\"post-ratings\" data-nonce=\"daa661f108\"><img id=\"rating_69_1\" src=\"http:\/\/4us2use.at\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"1 Star\" title=\"1 Star\" onmouseover=\"current_rating(69, 1, '1 Star');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img id=\"rating_69_2\" src=\"http:\/\/4us2use.at\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"2 Stars\" title=\"2 Stars\" onmouseover=\"current_rating(69, 2, '2 Stars');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img id=\"rating_69_3\" src=\"http:\/\/4us2use.at\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"3 Stars\" title=\"3 Stars\" onmouseover=\"current_rating(69, 3, '3 Stars');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img id=\"rating_69_4\" src=\"http:\/\/4us2use.at\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"4 Stars\" title=\"4 Stars\" onmouseover=\"current_rating(69, 4, '4 Stars');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img id=\"rating_69_5\" src=\"http:\/\/4us2use.at\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_off.gif\" alt=\"5 Stars\" title=\"5 Stars\" onmouseover=\"current_rating(69, 5, '5 Stars');\" onmouseout=\"ratings_off(0, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/> (No Ratings Yet)<br \/><span class=\"post-ratings-text\" id=\"ratings_69_text\"><\/span><\/span><span id=\"post-ratings-69-loading\" class=\"post-ratings-loading\"><img src=\"http:\/\/4us2use.at\/wp-content\/plugins\/wp-postratings\/images\/loading.gif\" width=\"16\" height=\"16\" class=\"post-ratings-image\" \/>Loading...<\/span>\n","protected":false},"excerpt":{"rendered":"<p>Problem Description: when restoring a SPSite from a backup to a new URL (longer), it didn&#8217;t work. Cause: for the new URL there would have been documents exceeding the 256 character URL limit\u200b Resolution: detach SQL database find documents re-attach and manually correct them USE SPC_Content_MyShared_01 declare @siteid as UniqueIdentifier set @siteid = &#8216;1cc13ce\u2019 select &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/4us2use.at\/?p=69\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Cannot rename SPSite on restore (Restore-SPSite)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/4us2use.at\/index.php?rest_route=\/wp\/v2\/posts\/69"}],"collection":[{"href":"http:\/\/4us2use.at\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4us2use.at\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4us2use.at\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4us2use.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69"}],"version-history":[{"count":2,"href":"http:\/\/4us2use.at\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":156,"href":"http:\/\/4us2use.at\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions\/156"}],"wp:attachment":[{"href":"http:\/\/4us2use.at\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4us2use.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4us2use.at\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}