Exception trying get context compatibility level: System.IO.FileNotFoundException

Bump into this error when hitting my SharePoint 2013 Web Application.

HTTP/1.1 200 OK Server: Microsoft-IIS/7.5 Date: <DATE TIME> GMT Connection: close

[sourcecode]
Exception trying get context compatibility level: System.IO.FileNotFoundException: The site <URL> could not be found in the Web application SPWebApplication Name=<WEB_APP_NAME>.
at Microsoft.SharePoint.SPSite.LookupSiteInfo(SPFarm farm, Boolean contextSite, Boolean swapSchemeForPathBasedSites, Uri& requestUri, Boolean& lookupRequiredContext, Guid& applicationId, Guid& contentDatabaseId, Guid& siteId, Guid& siteSubscriptionId, SPUrlZone& zone, String& serverRelativeUrl, Boolean& hostHeaderIsSiteName, Boolean& appWebRequest, String& appHostHeaderRedirectDomain, String& appSiteDomainPrefix, String& subscriptionName, String& appSiteDomainId, Uri& primaryUri)
at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.GetContextCompatibilityLevel(Uri requestUri)
[/sourcecode]

Subsequently, i tried to run powershell Get-SPSite <url>

Get-SPSite : Cannot find an SPSite object with Id or Url : xxxx

Tried to go to central admin and view all site collections. Amazingly, there is no Site Collection attached to the Web Application.  The site collection was GONE by no reason…

Steps to Recover the Site Collection

  1. Run the following Powershell.
    $tempSite = Get-SPDeletedSite
    $tempSite.Restore()
  2. That simple…

Leave a Reply

Your email address will not be published. Required fields are marked *