1

We are trying to clean up our Content Databases to remove errors such as MissingFeature. However we can't find these mission features using normal means, or any article I've yet found.

An example is

Category        : MissingFeature
Error           : True
UpgradeBlocking : False
Message         : Database [WSS_Content_DB1] has reference(s) to a missing feature: Id =
                  [2510d73f-7109-4ccc-8a1c-314894deeb3a].
Remedy          : Feature (Id = [2510d73f-7109-4ccc-8a1c-314894deeb3a]) is referenced in database [WSS_Content_DB1],
                  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       :

However the only place I can find a reference to this Feature Id is in the database itself under the FeatureTracking table.

I can directly delete these entries from that table and the errors go away.

Is there a supported method to remove these references to remove these errors from a Test-SPContentDatabase test?

Things we've tried

Get-SPFeature 2510d73f-7109-4ccc-8a1c-314894deeb3a

Returns nothing


Script from http://get-spscripts.com/2011/06/removing-features-from-content-database.html returns nothing


Get-SPFeature | ? { $_.Scope -eq $null }

Returns nothing


stsadm -o uninstallfeature -id 2510d73f-7109-4ccc-8a1c-314894deeb3a -force

Didn't fix this


select *
FROM [WSS_Content_DB1].[dbo].[Features]
where FeatureId = '2510d73f-7109-4ccc-8a1c-314894deeb3a'

Returns nothing


Feature Admin doesn't find anything missing

0

use this script it should help you. Remove ReportOnly switch after verifying it found what you need:

asnp Microsoft.SharePoint.Powershell

function Remove-SPFeatureFromContentDB($ContentDb, $FeatureId, [switch]$ReportOnly)
{
    $db = Get-SPDatabase | where { $_.Name -eq $ContentDb }
    [bool]$report = $false
    if ($ReportOnly) { $report = $true }

    $db.Sites | ForEach-Object {

        Remove-SPFeature -obj $_ -objName "site collection" -featId $FeatureId -report $report

        $_ | Get-SPWeb -Limit all | ForEach-Object {

            Remove-SPFeature -obj $_ -objName "site" -featId $FeatureId -report $report
        }
    }
}

function Remove-SPFeature($obj, $objName, $featId, [bool]$report)
{
    $feature = $obj.Features[$featId]

    if ($feature -ne $null) {
        if ($report) {
            write-host "Feature found in" $objName ":" $obj.Url -foregroundcolor Red
        }
        else
        {
            try {
                $obj.Features.Remove($feature.DefinitionId, $true)
                write-host "Feature successfully removed from" $objName ":" $obj.Url -foregroundcolor Red
            }
            catch {
                write-host "There has been an error trying to remove the feature:" $_
            }
        }
    }
    else {
        #write-host "Feature ID specified does not exist in" $objName ":" $obj.Url
    }
}

Remove-SPFeatureFromContentDB -ContentDB "WSS_Content_DB1" -FeatureId "2510d73f-7109-4ccc-8a1c-314894deeb3a" -ReportOnly

Hope it helps!

  • Thank you for a reply, but unfortunately I've tried that. I will update a list of things I've tried. – Kirk Feb 27 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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