How to Rename the Site Collection URL in SharePoint 2019 using PowerShell

Sathish Nadarajan
 
Solution Architect
April 10, 2020
 
Rate this article
 
Views
4332

During the migration, we will be creating huge number of site collections. While creating those site collections, we should be cautious about the Site URL. Recently, I made a type error while creating the Site Collection and did the Migration. After sometime, I realized that the URL has a typo. At that time, the below commands will be useful to rename the URL. But again, one important thing to notice is, the referenced links needs to be updated. It will not be updated automatically.

A simple method to rename the Site Collection URL – Thought of sharing.

$site = Get-SPSite http://MyWebApp/sites/gws1/
$site.Rename("http:// MyWebApp /sites/gws2/")

There are some important things to be noted when using this. The default links will be link corrected automatically. But, if we have few custom links based on the old URL, then they will not be renamed automatically. There are potential chances of link breaks. So, we need to be very careful while using this feature.

Happy Coding,
Sathish Nadarajan.

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

Leave a comment