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.
Leave a comment