How to manually remove legacy sites from SharePoint 2013 database?

Max Johnson 60 Reputation points
2023-12-01T14:22:36.78+00:00

I've been attempting to migrate my SharePoint 2013 database to SharePoint 2016. Every time I try though, I get an error message that "legacy sites are detected". I've already verified that all of my site collections are set to version 15. Is there a way to go into the database to clear the registry of those sites? Maybe its because I didn't install some features on SharePoint 2016 that are causing the issue?

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,291 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Haoyan Xue_MSFT 21,996 Reputation points Microsoft Vendor
    2023-12-04T06:45:28.16+00:00

    Hi @Max Johnson ,

    I understand what you are saying, your compatibility level has been upgraded to 15, but you are still getting the "using SharePoint 2010 experience" error. If you want to try to remove these site collections from the database, you can use the following Powershell:

    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
     
    $CorruptedSiteURL ="https://intranet.crescent.com/sites/sales"
     
    #Get the site collection
    $site = Get-SPSite $CorruptedSiteURL
     
    #Get the GUID of the site collection
    $siteGUID = $site.Id
    Write-host "Site collection GUID:"$siteGUID
     
    #Get the content Database of the Site collection
    $siteDatabase = $site.ContentDatabase
     
    #Force delete the site collection
    $siteDatabase.ForceDeleteSite($siteGUID, $false, $false)
    
    

    Hope the information can help you. If there's anything else I can help you with, happy to oblige. Have a good day and keep safe!

     


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.