Content database shows 0 sites


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

@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?