Change a SharePoint site collection top-level site URL

Changing a SharePoint site collection name is easy enough (Site Settings –> “Title, description, and logo”), but changing the URL for a top-level site is a bit more involved than just changing a subsite URL. Note that this post applies to on-premise/server environments only.

  1. Connect to/log in to your SharePoint server
  2. Open SharePoint 2013/2016 Management Shell in administrator mode (right-click, “Run as administrator”
    Capture.PNG
  3. Once the module loads, enter the following three cmdlets (I recommend typing and entering them one line at a time, not copying and pasting):

$site = Get-SPSite https://sharepoint.mycompany.com/sites/OldName
$site.Rename("https://sharepoint.mycompany.com/sites/NewName")
iisreset

After the IISReset cmdlet is run, it may still take a small while for the new site’s URL to work as expected.

Notes

  • If you’re receiving “Get-SPSite : Cannot find an SPSite object with Id or Url: http://…” it could be you’re attempting to change the URL for a subsite, not a site collection top-level site.
    chrome_2018-11-01_08-38-39.png
  • This renaming method will only work for managed paths (central admin –> manage web applications –> select a web app and “managed paths”) that are of type “wildcard inclusion”. Typically out of the box this only includes “sites”
    wildcard inclusion.png
  • This article first published by Waqas Sarwar does a good job of explaining the pros and cons of alternative methods (such as Copy-SPSite and Backup & Restore), as well as the limitations: SharePoint 2016: Rename Site Collection URL Best Practice

 

3 Replies to “Change a SharePoint site collection top-level site URL”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.