Convert path-based site collection to host-named site collection – SharePoint 2013

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 Path named site collection is something which looks like

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

Convert path-based site collection to host-named site collection

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.

Leave a Reply

Your email address will not be published.

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

Disable feedback surveys in Power Platform

If you have worked in Microsoft 365 PowerApps or Power Automate, you might be familiar with feedback survey which pops up quite often. Microsoft wants your feedback on how likely are your to recommend Power Automate to a friend or colleague? Well, I ran into a conversation in twitter about this survey. Apparently I learnt […]

Read More

Error handling in Azure PowerShell Runbooks

Error handling in Azure PowerShell Runbooks should be handled carefully if not the runbook with continue to Completed state even if there is an Error in the script. Unlike exception, Runbook execution will continue after  an Error  by default. Windows PowerShell has multiple streams of output. Runbooks in Azure work differently in each of these […]

Read More

SharePoint Designer cannot display the item

You run into ‘SharePoint Designer cannot display the item’ error when you are trying to edit an existing workflow setup in Designer quite often when there is a windows update or update to .NET framework installed in your computer. In some cases it may also not allow you to create new workflows. Resolution: Clearing Designer […]

Read More