0

Test-SPContentDatabase has found missing features.

Some I can remove and some unremovable, because the script If($web.Features[$featureID]) or If($Site... doesn't find anything.

I'm sure to copy the exact id values for site and feature. Any ideas to remove this impurity?

Thanks

3
  • Please provide output of Test-SPContentDatabase and your clean-up script.
    – Raf
    Oct 30, 2019 at 11:31
  • Category : MissingFeature Error : True UpgradeBlocking : False Message : Database [WSS_blabla] has reference(s) to a missing feature: Name = [name], Id = [20b4b767-...], Description … Install Location = [NameAddon_AddonFeature]) is referenced in database [WSS_blabla], but isn't installed on the current farm. The missing feature might cause upgrade to fail. If necessary, please install any solution that contains the feature and restart upgrade. Locations : {03f62644-..., ...} Oct 30, 2019 at 13:04
  • $featureID = "20b4b767-..." $siteID = "03f62644-b0c1-..." $Site = Get-SPSite $siteID Write-Host "Checking Site:" $site.Url ForEach ($web in $Site.AllWebs) {         If($web.Features[$featureID]) {                 Write-Host "nFound Feature $featureID in web:"$Web.Url"removing feature" -ForegroundColor Green $web.Features.Remove($featureID, $true)             }  } Oct 30, 2019 at 13:06

3 Answers 3

1

In SharePoint content db migration some error we can ignore this will not harm anything.Even though we get some error during the database upgrade we may ignore them, as this is generally common behavior in migration project.

Even I had also faced the similar kind of issue and figured this out by doing the proper analysis in the source system. One of the key parameter for succeeding the migration project is proper planning and analyzing the source environment. Try to get an inventory from your source system about all custom solution and where (in which sites) these custom features are activated, I am sure from the inventory report you will find there are many features those are not really being used in the source system. So you can clean those unwanted feature from target environment – after running the Test-SPContentDatabase command.

PowerShell sample for running Test-SPContentDatabase:

$wa = Get-SPWebApplication https://sharepoint.contoso.com" 
$outputPath = "\\tools\files\Output\Test_Wss_Content_MissingAssembly_{0}.txt" -f (Get-Date -Format hhmmss 
 $dbName = "WSS_Content_MissingAssembly" 
  $slqServer = "SPSQL" 
 Test-SPContentDatabase -Name $dbName -WebApplication $wa -ServerInstance 
 $slqServer -ShowLocation:$true -ExtendedCheck:$false | Out-File $outputPath Write-Host "Test results written to $outputPath" 

PowerShell sample for removing features by ID:

$featureID = "ed37484a-c496-455b-b083-3fc157b1603c"
$siteID = "108d28e9-dac1-4eea-9566-6591394e6d40"   

#Display site information
$site = Get-SPSite $siteID  
Write-Host "Checking Site:" $site.Url

  #Remove the feature from all subsites
 ForEach ($web in $Site.AllWebs)
{
    If($web.Features[$featureID])
        {
            Write-Host "`nFound Feature $featureID in web:"$Web.Url"`nRemoving feature"
            $web.Features.Remove($featureID, $true)
        }
        else
        {
            Write-Host "`nDid not find feature $featureID in web:" $Web.Url
        }   
}

  #Remove the feature from the site collection
  If ($Site.Features[$featureID])
{
    Write-Host "`nFound feature $featureID in site:"$site.Url"`nRemoving Feature"
    $site.Features.Remove($featureID, $true)
}
else
{
    Write-Host "Did not find feature $featureID in site:" $site.Url
}

PowerShell sample for removing setup files by ID:

#File Information
$setupFileID = "07462F03-A4C6-455C-B383-947DDE85DF36"
$siteID = "108D28E9-DAC1-4EEA-9566-6591394E6D40"
$WebID = "4E068646-2C87-4868-924E-850C31F607DF"

 #Get file
 $site = Get-SPSite -Identity $siteID
 $web = Get-SPWeb -Identity $WebID -Site $siteID
 $file = $web.GetFile([GUID]$setupFileID)

#Report on location
$filelocation = "{0}{1}" -f ($site.WebApplication.Url).TrimEnd("/"), 
$file.ServerRelativeUrl
Write-Host "Found file location:" $filelocation

#Delete the file, the Delete() method bypasses the recycle bin
$file.Delete()

$web.dispose()
$site.dispose()

Notes:

  • You may ignore the error or exception from Test-SPContentDatabase
    command, still your Mount-SPContentDatabase will work.
    • While running the Mount-SPContentDatabase for certain content database – if you get an exception or up to some extend some errors, you can ignore those and continue in further migration, still your migrated site will work fine and in these scenario if you see database upgrade status from central admin, we can see upgrade completed with errors status but we can live with this.
    • After content db migration thru database detach and attach approach – we may see some issues in the migrated master page, css and java script code as a result we may expect some differences in the migrated site look and feel and other css and scripting related issue – this is a general behavior which we need to fix manually even though it is time consuming.

Reference URL:

1
  • I still don't understand why, after applying your code above, some missing feature is removed, because found ( in the If($web.Features[$featureID] part) and some found only in the test-spdatabase part Nov 5, 2019 at 7:20
1

You can use FeatureAdmin to help remove missing features.

2
  • cannot install exe of any kind, I'd prefer to use powershell, script by script Oct 31, 2019 at 7:55
  • It’s not an installer. Just extract and run.
    – user6024
    Oct 31, 2019 at 14:34
0

Was the content database migrated from an earlier version of SharePoint (SP) like 2010 farm? In that case, it is possible that the missing features are in fact missing in the new farm.

We've seen such errors when we migrated site collections from SP 2010 to SP 2013. In our case, we didn't install few third party tools in the new SP 2013 farm, but since the content databases still had references to those features, we got those errors when upgraded by mounting content databases in the new farm. We simply ignore those errors in the new farm.

1
  • there was a double step: from 2010 to 2013 and from 2013 to 2016. 2013 only to upgrade databases. All the missing features has come from 2010. I wonder why I did remove references for some of them only. Oct 31, 2019 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.