Moving a SharePoint 2010 Host Header Site Collection to a new server in a new domain.

This example describes how to move a SharePoint 2010 Host Header (HHURL) site collection from a server in domaina to a new server in domainb. The example also deals with migrating users within the HHURL site collection from domaina to domainb.

The existing HHURL site collection is currently on hosta and Content Database is existingDB.
Create a new HHURL site collection on on hostb and Content Database is mynewscDB.
Ensure your DNS record for the new HHURL site collection is mapped correctly i.e. you can get to it from the outside world.
Login to the new site collection and verify.
Backup the existing site collection on hosta to scbackup.bak file using Central Admin > Backup & Restore > Granular Backup > Perform a Site Collection Backup.

Restore the existing site collection backup (scbackup.bak) file from hosta to the site collection on hostb using the following Powershell cmdlet.

PS C:\> Restore-SPSite -Path C:\scbackup.bak -ContentDatabase mynewscDB -Force -HostHeaderWebApplication http://hostb
***Note http://hostb is the Web App under which the site collection lives ***.
In Central Admin > Application Management > Site Collections > Change Site Collection Administrators; change the site collection administrator to domainb\spadminaccountb on the site collection .
Add domainb\spadminaccountb to the site as an administrator using the New-SPUser cmdlet.
PS C:\> New-SPUser -UserAlias ‘domainb\spadminaccountb’ -Web -DisplayName ‘spadminaccountb’ -SiteCollectionAdmin .
Do an IISRESET (Important !!).
Browse to your new site collection , login as the spadminaccountb user and you’ll see content from the ‘old’ location . You should still see the users listed against content submissions from the old domain e.g. domaina\spadminaccounta .
Users in the new collection can be updated as follows using Powershell cmdlets:
PS C:\> $user=Get-SPUser -Web http:// -Identity DOMAINA\usera
PS C:\> Move-SPUser -Identity $user -NewAlias DOMAINB\userb -IgnoreSID
Have a look at the users on the site collection and you’ll see that the Identity (DOMAIN\user) has changed but the alias (user) remains the same, you’ll only notice this if the actual usernames are different in each domain.
Now update the DisplayName using Powershell cmdlets:
PS C:\> $user=Get-SPUser -Web http:// -Identity DOMAINB\user1
PS C:\> Set-SPUser -Identity $user -displayname userb

That’s it, I still have to test workflows, custom code deployments, etc … post migration; but this example should be enough for a lot of people using OOTB SharePoint.



  1. ShareBB said

    Good Post. It works!

  2. Bob said

    Some basic questions:
    Are domainA and domainB in the same forest ?
    Do I have to migrate user accounts (admt) from domainA to domainB before moving sharepoint site ?

    • lukieb said

      Bob, domainA & domainB were in different forests.
      I did not migrate users between domains, but I had set users up in the new domain (domainB) with the same usernames as domainA.

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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

%d bloggers like this: