With SharePoint 2013 and Office 365 Host named site collections have become an instant hit.Microsoft introduced a new Powershell command with February 10, 2015 Cumulative update KB2910928 to convert path-based site collections to host-named site collections.
First of all,a host named site collection is something which has its own DNS entry and looks like http://host.mycompany.com. Path named site collection is something which looks like http://site.mycompany.com/sites/host.
When you migrate to cloud, you start at site collection level and don’t have the option to create multiple web applications with different host names. This command comes very handy to convert your path based site collections as host name site collections which appears same as having mutliple web applications for end users.
Here are the two new methods
- SPSite.Rename(Uri newUri)
- SPSite.Rename(Uri newUri, bool skipSiteMapUpdate)
skipSiteMapUpdate by default is False. If you set the value to true, the method does not update the sitemap during the rename process. Therefore, you should use the SPContentDatabase.RefreshSitesInConfigurationDatabase method to refresh the configuration database after the rename process is complete
Here is the complete script to convert path-based site collection to host-named site collection.
An IISRESET should be performed to refresh the sites.
This should be a good enough reason to install Feb 2015 CU. Tood Klindt has written a post about this and explained in detail about other uses of this command.