Migrating to SharePoint Host Name Site Collections

 

According to technet article https://technet.microsoft.com/en-us/library/cc424952.aspx , “Host-named site collections provide a scalable Web hosting solution with each site collection assigned to a unique DNS name. In a Web hosting deployment, each host-named site collection has its own vanity host name URL, such as https://customer1.contoso.com, https://customer2.contoso.com , or https://www.customer3.com”.

Host Name Site Collection is actually a means to have a separate DNS for each site collection rather than having all the site collections follow the URL of the web application (path-based site collections). The advantages and limitations of this approach as well as an overview of Host Named site collections is present at https://technet.microsoft.com/en-us/library/cc424952.aspx

A sample power shell script to create a web application for Host Name Site collections as well as creating a host named site collection under it is as follows:

$webTemplate = "STS#1"

$hostHeaderWebApp = "https://<WebAppName>:<WebAppPort>"

$hostHeaderWebAppPort = <WebAppPort>

$AppPoolName = <AppPoolName>

$AppPoolAccount = <AppPoolAccount>

$firstHostNamedSiteCollection = <URL of Host Name Site Collection>

$firstHostNamedSiteCollectionContentDB = <Content Database for Site Collection>

$webApp = New-SPWebApplication -ApplicationPool $AppPoolName -ApplicationPoolAccount $AppPoolAccount -Name $AppPoolName -Port $hostHeaderWebAppPort -AuthenticationMethod NTLM

New-SPContentDatabase -Name $firstHostNamedSiteCollectionContentDB -WebApplication $hostHeaderWebApp

$SpSite = New-SPSite $firstHostNamedSiteCollection -ContentDatabase $firstHostNamedSiteCollectionContentDB -OwnerAlias <OwnerDomainAccount> -HostHeaderWebApplication $hostHeaderWebApp -Template $webTemplate