August 13, 2010

What to do if you unintentionally delete your SharePoint 2007 site AppPool or website from IIS?

I was playing with SharePoint and trying to break it in any way possible (which is easy btw, just think outside the box!)

So I went to IIS, and firstly deleted my SharePoint – 8090 Website and guess what? I can no longer access my site. Imagine if that was a production site!!!

Problem: I deleted my Website for my Site in IIS (now this can happen for other reasons than just deleting it manually) and need to restore it without loosing my data stored in content database.

Solution: you are screwed! no I’m just kidding… the beauty of SharePoint 2007 is that they have thought of that and already have a solution for it.

Note: I would strongly recommend creating a full backup of your environment before trying this approach as  its not a guarantee that you will get your sites back and running and may affect other running applications/processes that may have used that website for other reasons.

  1. Start Internet Explorer and navigate to Central Administration site
  2. Click Application Management tab and then click Content Databases under SharePoint Web Application Management section.
  3. Make sure that your web application affected is selected and write down the content DB name (in my case its WSS_Content_8090) image
  4. Click Application Management tab and then click Delete Web Application under SharePoint Web Application Management section.
  5. Make sure that Delete content databases is set to No. image, click Delete
  6. Once operation is completed. click Create or Extend Web Application under SharePoint Web Application Management section, then click Create new Web Application.
  7. Configure the web application to use port 8090 (or any other port if you want to use a different port this time)
  8. The key thing now is to choose the same content database now as the one that was attached to the affected site (in my case it was WSS_Content_8090)
  9. Once done, click Ok and wait for the process to complete.
  10. That’s it! Try to navigate to your site and you should be able to see the contents.

No comments:

Post a Comment