Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a site collection set up at web app running at port 80. I have made the backup of the site collection content db using stsadm.exe tool. Now, I want to restore that backup as a new content db of a different site collection - the one set up at web app running at port 500. I have done the following:

  1. Created a backup
  2. Created new web app at port 500 (I did not create a site collection for this web app)
  3. I have removed the content db of that new web app using Central Administration
  4. I have run the stsadm.exe -o addcontentdb -url webapp-at-port-500 -databasename <name>
  5. Command is successfully completed, however when I check the Content Database page for that web app, it says that the Number of Sites is 0! Also, when I try to open http://webapp-at-port-500, I get the error saying that the webpage cannot be found.
share|improve this question

migrated from Oct 15 '09 at 11:58

This question came from our site for professional and enthusiast programmers.

before restoring database just stop sharepoint service timer service . – user320945 Nov 7 '15 at 10:21

There is an annoying limitation of WSS3/2007 that prevents you from attaching the same content database more than once on an entire installation - the ID for the Site Collection is unique, and these are used as primary key in a table in the Config DB (shared for all web apps). You can get round this by either a) attaching the Content DB somewhere else (inconvenient), or hacking the offending table in the Config DB (potentially dangerous, although I've done this a couple of times with no ill effects); see SharePoint Things for details.

share|improve this answer

Whether or not a Site Collection has any Sites is not solely handled by the Content DB. The central Configuration Database also manages some of that information.

In my experience, I have always had to create a blank site on a new Site Collection before restoring and attaching a different content database.

Also, I'm used to managing the content databases through the Central Admin UI.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.