Tuesday, July 6, 2010

404 Error after detaching and reattaching database content in SharePoint 2010

I was troubleshooting view pdf document via a web browser, and one of the steps I took to troubleshoot the issue was to detach and reattach the content database. I did this via the UI from central administration page and when I tried to open SharePoint site, I got 404 error.... So, I went to Central Admin site and verified that it show the correct number of sites, I even created a new site and the number of sites increased, but I could not browse to the newly created site (Note: the content is about 5 GB, which is fairly small).

What I did to fix the issue was to run PowerShell command to detach and reattach the content database as describe im MS technet article:

To detach content database: 
Dismount-SPContentDatabase ""


To attach content database: 

Mount-SPContentDatabase "" -DatabaseServer "" -WebApplication http://SiteName



I am not sure why doing this action from Central Administration page created the issue in the first place, but from now on, I will start using PowerShell to administer SharePoint 2010.

1 comment: