Solving Feature is referenced in database but isn't installed on the current farm
One of the known issues in SharePoint Server when trying to run the configuration wizard to apply new cumulative updates and failing to complete is "Feature is referenced in database, but isn't installed on the current farm".
Why you got "Feature is referenced in database, but isn't installed on the current farm" in SharePoint 2019?
This error occurs due to Missing Features Dependencies that are already referenced in your content database that it's not currently installed in your farm.
How to solve "Feature is referenced in database, but isn't installed on the current farm" in SharePoint 2019?
To solve this issue you have to do the following:
- Fix Missing Server Side Dependencies by removing the missing features from the farm
- Fix the Content Database Version Mismatch
1) Removing the missing features from the farm in SharePoint 2019
In your SharePoint Server, Open Windows PowerShell as Administrator and run the below PowerShell script to remove all missing features from your farm:
Add-PSSnapin 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 "Your Content DB Name" -FeatureId "e9728ee6-7bfc-40a1-ad72-aa9a57e14407"
Note: It would be also great to check all missing dependencies as mentioned in Missing Server Side Dependencies SharePoint 20192016 Health Analyzer
2) Fix the Content Database Version Mismatch
Again run the SharePoint 2019 PowerShell as Administrator, and run the below command line to update the content database schema.
Get-SPContentDatabase | Upgrade-SPContentDatabase
Try now to run the SharePoint Configuration wizard which should be completed successfully.
See Also