Migrating to SharePoint Host Name Site Collections 3

In my previous 2 posts on Host Named Site Collections, I laid out the powershell scripts to create Host Name site collections as well as creating managed paths under them.

After that, these site collections can be handled using PowerShell scripts normally.

In case of needing to migrate path-based site collections to host-named site collections, you can simply backup the path-based site collection & restore it to the newly created host named site collection.

A sample script for such backup & restore operation is as follows:


$hostHeaderWebApp = “http://<WebAppName&gt;:<WebAppPort>”

$firstHostNamedSiteCollection = “<URL of Host Name Site Collection>”

$OriginalSiteCollection = “<URL of Path Based Site Collection>”

$BackupPath = “c:tempTestSiteBackup.bak”


Backup-SPSite $OriginalSiteCollection -Path $BackupPath

Restore-SPSite -Identity $firstHostNamedSiteCollection -Path $BackupPath -HostHeader $hostHeaderWebApp -Force

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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