none
Sharepoint 2013 sitecollection deletion error RRS feed

  • Question

  • Hello,

    We had some corruption with our test site collection and i decided to delete it completely.

    The site collection is visible in central admin but when i select it, it shows no info and can not be deleted from there.

    So i decided to use the powershells script but it says the site is not found.

    The content database for it was deleted, but the event log is still trying to access it because it seems the sitecollection is still present somewhere.

    Has anyone suggestions to fix this issue?

    Friday, January 20, 2017 12:44 PM

Answers

  • Hi,

    thanks to you pointing me to the resolution i was able to delete the orphaned site.

    Bascialy what i had to do is restore the database from a backup and then run the full script, the part without database did not work for me.

    Add-PSSnapin Microsoft.SharePoint.PowerShell
    $CorruptSites = "http://intranet/sites/test"

    Function DeleteCorruptSite
    {
    param($CorruptSite)
    Write-Host $CorruptSite : -foreground red
    $site = Get-SPSite $CorruptSite
    $siteId = $site.Id
    $siteDatabase = $site.ContentDatabase 
    $siteDatabase.ForceDeleteSite($siteId, $false, $false)
    Write-Host --Deleted from Content DB -foreground green
    }
    foreach ($CorruptSite in $CorruptSites)
    {
     DeleteCorruptSite $CorruptSite
    }

    • Marked as answer by Fazzzer Monday, January 23, 2017 10:15 AM
    Friday, January 20, 2017 1:22 PM

All replies

  • Since the content database was deleted I suspect you have an orphan entry for the site collection in your config database.  Here's an article on how to clean up orphans.  I suspect you need option #4

    https://social.technet.microsoft.com/wiki/contents/articles/21968.sharepoint-deleting-orphan-sites.aspx


    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    • Proposed as answer by testor2 Friday, January 20, 2017 1:19 PM
    Friday, January 20, 2017 12:49 PM
  • Hi,

    i ran this in powershell

    $site = Get-SPSite "http://intranet/sites/test/";
    $siteId = $site.Id;
    $siteDatabase = $site.ContentDatabase;
    $siteDatabase.ForceDeleteSite($siteId, $false, $false);

    it gave no feedback and it seems the test sitecollection is still present.

    Friday, January 20, 2017 1:05 PM
  • Hi,

    thanks to you pointing me to the resolution i was able to delete the orphaned site.

    Bascialy what i had to do is restore the database from a backup and then run the full script, the part without database did not work for me.

    Add-PSSnapin Microsoft.SharePoint.PowerShell
    $CorruptSites = "http://intranet/sites/test"

    Function DeleteCorruptSite
    {
    param($CorruptSite)
    Write-Host $CorruptSite : -foreground red
    $site = Get-SPSite $CorruptSite
    $siteId = $site.Id
    $siteDatabase = $site.ContentDatabase 
    $siteDatabase.ForceDeleteSite($siteId, $false, $false)
    Write-Host --Deleted from Content DB -foreground green
    }
    foreach ($CorruptSite in $CorruptSites)
    {
     DeleteCorruptSite $CorruptSite
    }

    • Marked as answer by Fazzzer Monday, January 23, 2017 10:15 AM
    Friday, January 20, 2017 1:22 PM