We have Hosted Names Site Collections in both Dev and QA and I am have been assigned the task of Refreshing the QA db with Dev db, please let me know if any of the below steps taken are wrong

  1. Take a backup of the Dev db
  2. Detach the DB of QA from the QA WebApp
  3. Mount the Dev db on the QA WebApp

If it was Path Based Site Collection this would be perfect scenario but now since the Sites are Host Based Site Collection do i need to worry about anything do i need to do something else.


Yes, You need to set the url for the HNSC. Even url comes with the content DB but not accessable. SO follow these steps.

  • Mount-SPContentDatabase -Name -DatabaseServer -WebApplication -confirm:$false

  • Get-SPSite -ContentDatabase | Format-Table -Property Url, ID

  • Set-SPSite -Identity -Url

Now test it.


You can use PowerShell to Restore Content Databse Backup

Restore-SPSite -Identity <Site collection URL> -Path <Backup file> [-DatabaseServer <Database server name>] [-DatabaseName <Content database name>] [-HostHeader <Host header>] [-Force] [-GradualDelete] [-Verbose]

<Site collection URL> - Will be the URL of the host-named site collection

<Backup file> - Database backup file path

<Database server name> - Database server name

<Content database name> - Name of Database to Restore

<Host header> - Will be URL of the Web application that will hold the host-named site collection

  • this will not restore the DB rather this will restore the site collection from backup to the mentioned DB....He has DB and want to mount it. – Waqas Sarwar MVP May 15 '15 at 15:03
  • 1
    True @WaqasSarwarMCSE since i needed the whole DB restored and not just one SiteCollectionm i did the below and it was successfull 1) I removed the Existing QADB from the WebApp using CA 2) Used the Mount Command to Mount the DevDB to the QA WebApp even after doing that the URL's and WebApp were all Dev 3) Now used the below $Site = Get-SPsite - Identity constoso.old $site.Rename "constoso.new This renamed all the Dev URL's with the QA and everything works fine now.Thank You – SavantProdigy May 18 '15 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.