I have a Sharepoint Farm and I want a clone of it, under a different hostname (Preprod vs. prod).

We setup the Preprod farm from scratch, with new Web Applications. We then restored a backup of the WSS_Content database and attached it using Central Admin.

When browsing the main site collection (/), I get a HTTP 404 not found. If i go into Central Admin and View All Site Collections, I don't even get the box that has the URL, Title, Description etc. fields. When trying to get to it from PowerShell using Get-SPSite and site.OpenWeb(), it's not returning a site.

Other site collections work fine though, and there is nothing obvious in the logs, so I really don't know where the 404 comes from and how to troubleshoot it.

2 Answers 2


You'll need to detach and re-attach your content database.

If you go to the central administration and your site collection information are missing do the following (Post restoration of your database)

Stsadm -o deletecontentdb -url {Site Url} -databasename {Content Database Name}
Stsadm -o addcontentdb -url {Site Url} -databasename {Content Database Name}

Later on, for similar scenario, you should use stsadm -o export (-o import) functionalities or stsadm -o backup / restore if you want to avoid this (or the powershell equivalent)

Hope it helps.

  • The lack of information on the central admin sounds like a good candidate for a wrongly attached content database IMHO. Alternatively, I would fire a trusty Fiddler to see what's blocking and ensuring IIS is responding to the relevant binding on the pre-prod environment (btw, is a vanilla site working on the pre-prod on that specific site collection ?) Jul 31, 2012 at 20:16
  • got it, but my advice was to use stsadm -o backup or stsadm -o export rather than SQL Server content database backup. I'll clarify my answer. Thanks ! Jul 31, 2012 at 20:21
  • You're good, I was just telling him to ignore that. Jul 31, 2012 at 20:21
  • Will try Farm backup and restore as well. Fiddler isn't a great help here, but I can confirm that I'm definitely hitting SharePoint. It seems like a problem actually fetching the site from the database. Jul 31, 2012 at 20:31

At the end, the issue was that the target web application didn't have the exact same Managed Paths setup. Apparently, if they don't match, attaching the database creates the wrong IDs in the SiteMap table within the Config database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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