Content database shows 0 sites

%3CLINGO-SUB%20id%3D%22lingo-sub-1214406%22%20slang%3D%22en-US%22%3EContent%20database%20shows%200%20sites%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1214406%22%20slang%3D%22en-US%22%3E%3CP%3ESo%20let%20me%20start%20by%20admitting%20sometimes%20I%20do%20stupid%20things.%20We%20were%20collapsing%20our%20SharePoint%202010%20farm%20a%20few%20months%20ago%20but%20instead%20of%20just%20turning%20everything%20off%20I%20started%20deleting%20web%20applications%20as%20they%20were%20migrated%20off.%20Fast%20forward%20to%20today%20and%20I%20learn%20another%20application%20has%20some%20of%20it%20js%20files%20and%20custom%20css%20files%20in%20a%20folder%20in%20a%20web%20application%20that%20I%20deleted.%20No%20problem%20I%20think%2C%20I'll%20just%20recreate%20the%20web%20application%20and%20mount%20the%20content%20database%20then%20I'll%20be%20able%20to%20cover%20these%20files%20and%20move%20them%20somewhere%20else.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOr%20so%20I%20thought.%20I%20created%20the%20web%20application%20indicating%20the%20original%20content%20database%20as%20it's%20database.%20When%20it's%20complete%20the%20web%20app%20isn't%20accessible%20and%20the%20content%20database%20shows%200%20sites.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20do%20i%20recover%20from%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1214406%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1216135%22%20slang%3D%22en-US%22%3ERe%3A%20Content%20database%20shows%200%20sites%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1216135%22%20slang%3D%22en-US%22%3ETry%20this%20in%20Central%20Admin%3CBR%20%2F%3E-%20create%20a%20new%20content%20database%3CBR%20%2F%3E-%20create%20a%20site%20collection%20in%20the%20database%3CBR%20%2F%3E-%20remove%20the%20newly%20created%20database%20from%20the%20web%20application%3CBR%20%2F%3E-%20attach%20the%20restored%20database%20to%20the%20web%20application%3CBR%20%2F%3E%3CBR%20%2F%3Ethe%20problem%20is%20the%20reference%20to%20the%20site%20collection%20is%20stored%20in%20the%20configuration%20database%2C%20so%20if%20you%20don't%20create%20this%20first%20the%20web%20application%20won't%20see%20the%20site%20collection%20in%20the%20content%20database.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1217564%22%20slang%3D%22en-US%22%3ERe%3A%20Content%20database%20shows%200%20sites%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1217564%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F43161%22%20target%3D%22_blank%22%3E%40Steve%20Knutson%3C%2FA%3E%26nbsp%3B%2C%20thank%20you%20for%20your%20reply.%20I%20followed%20your%20steps%20but%20still%20had%20no%20luck.%20I%20removed%20the%20restored%20database%20from%20the%20Web%20Application%2C%20created%20and%20new%20content%20database%20and%20created%20a%20site%20collection%20on%20the%20root%20of%20the%20web%20app(which%20is%20where%20the%20site%20collection%20I%20need%20was%20originally%20created)%20I%20then%20navigated%20to%20the%20new%20site%20and%20all%20was%20well%20so%20far.%20I%20then%20removed%20the%20newly%20created%20content%20database%20and%20mounted%20the%20restored%20database.%20CA%20shows%20no%20site%20collection%20on%20the%20database.%20On%20examination%2C%20I%20confirmed%20the%20restored%20database%20does%20contain%20a%20site%20collection%20it%20just%20isn't%20picked%20up%20in%20CA.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDid%20I%20miss%20something%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

So let me start by admitting sometimes I do stupid things. We were collapsing our SharePoint 2010 farm a few months ago but instead of just turning everything off I started deleting web applications as they were migrated off. Fast forward to today and I learn another application has some of it js files and custom css files in a folder in a web application that I deleted. No problem I think, I'll just recreate the web application and mount the content database then I'll be able to recover these files and move them somewhere else.

 

Or so I thought. I created the web application indicating the original content database as it's database. When it's complete the web app isn't accessible and the content database shows 0 sites.

 

How do i recover from this?

2 Replies
Highlighted
Try this in Central Admin
- create a new content database
- create a site collection in the database
- remove the newly created database from the web application
- attach the restored database to the web application

the problem is the reference to the site collection is stored in the configuration database, so if you don't create this first the web application won't see the site collection in the content database.
Highlighted

@Steve Knutson , thank you for your reply. I followed your steps but still had no luck. I removed the restored database from the Web Application, created and new content database and created a site collection on the root of the web app(which is where the site collection I need was originally created) I then navigated to the new site and all was well so far. I then removed the newly created content database and mounted the restored database. CA shows no site collection on the database. On examination, I confirmed the restored database does contain a site collection it just isn't picked up in CA.

 

Did I miss something?