Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
  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.

Could anyone please help me, it's driving me crazy. Thanks.

share|improve this question

migrated from stackoverflow.com Oct 15 '09 at 11:58

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

2 Answers 2

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

 
discard

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