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.
- Connect to/log in to your SharePoint server
- Open SharePoint 2013/2016 Management Shell in administrator mode (right-click, “Run as administrator”
- 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.
- 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”
- 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
Thank you very much for sharing!