1

Someone in my company installed a test feature on a live site. Now I'm trying to clean up this test feature, and am not sure where all to look to get rid of the one feature that I have left. This is the output of the test-spcontentdatabase command. How do I clean this feature out of my site, esp. since the location isn't there? I don't see the feature/webpart name in test-spcontentdatabase.

Category        : MissingFeature
Error           : True
UpgradeBlocking : False
Message         : Database [EshcomSite] has reference(s) to a missing feature:
                  Id = [ad072ddb-edc3-41b3-b1aa-bb44d7a8c6ea], Name = [Bamboo
                  Tree View Web Part], Description = [Quickly view list,
                  library, and discussion items, Wiki pages and sites using a
                  hierarchical tree view navigation structure.], Install
                  Location = [Bamboo.TreeView].
Remedy          : The feature with Id ad072ddb-edc3-41b3-b1aa-bb44d7a8c6ea is
                  referenced in the database [EshcomSite], but is not
                  installed on the current farm. The missing feature may cause
                  upgrade to fail. Please install any solution which contains
                  the feature and restart upgrade if necessary.
Locations       :

Category        : MissingSetupFile
Error           : True
UpgradeBlocking : False
Message         : File [Features\Bamboo.TreeView\WebParts\Bamboo.TreeView.dwp]
                  is referenced [4] times in the database [EshcomSite], but is
                  not installed on the current farm. Please install any
                  feature/solution which contains this file.
Remedy          : One or more setup files are referenced in the database
                  [EshcomSite], but are not installed on the current farm.
                  Please install any feature or solution which contains these
                  files.
Locations       :

Category        : MissingWebPart
Error           : True
UpgradeBlocking : False
Message         : WebPart class [65800c63-514d-a645-2d07-7acdc39542b7] (class
                  [Bamboo.WebParts.TreeView] from assembly [Bamboo.TreeView,
                  Version=1.0.0.0, Culture=neutral,
                  PublicKeyToken=2cc91efae2d531be]) is referenced [2] times in
                  the database [EshcomSite], but is not installed on the
                  current farm. Please install any feature/solution which
                  contains this web part.
Remedy          : One or more web parts are referenced in the database
                  [EshcomSite], but are not installed on the current farm.
                  Please install any feature or solution which contains these
                  web parts.
Locations       :
3

What you are seeing are references in your database after a solution/webpart that was not removed correctly.

I assume that you just uninstalled and removed the solution? If you know in which site och sub site the web part and feature was activated, you could add and install the solution again to your farm and follow those steps:

  • Go to the site or sub sites where the web part is/was and remove it either by edit the page or when at the specific site add ?contents=1 to the end of the url. This will take you to the sites Web Part Page Maintenance. Example: http://serverName/sites/subsite/default.aspx?Contents=1

From here you can remove the web parts.

  • Go to the top level site collection > site settings > web part gallery and remove the web part from the gallery. ( Bamboo.TreeView.dwp ) Remember to empty the recycle bin and the site collection admin recycle bin.

  • After the 2 steps above have been completed, inactivate the feature, on all the sub sites where it was activated and the top-level site. Make sure that you have removed all the references before deactivating it. Use test-spcontentdatabase frequently to see that you are making progress and are getting rid of the web part references.

  • When the database is clean and the feature is deactivated, you can finally uninstall and remove the solution again.

Do this after work hours, because deploying the solution and removing it will cause an IIS-reset to your farm.

Hope this helps.

  • How do I find all the places that are using that webpart or feature? That webpart was added to a template, and I'm not sure all the sites that were created with that template. – Trevor Newhook Aug 20 '14 at 16:47
  • Well the best way to found out would be to ask the guilty employee to start with, if that is possible? – Christoffer Aug 20 '14 at 17:56
  • I checked all the sites I thought were created with that template, and they're not using that webpart, so I'm not sure where to go next – Trevor Newhook Aug 20 '14 at 18:10
  • Do you know any powershell? I think this thread can bring you forward with searching for the feature. sharepoint.stackexchange.com/questions/76245/… – Christoffer Aug 20 '14 at 18:34
3

There are couple of ways to remove it.

Using Powershell

First, using this Powershell script by Phil Childs:

To use the script, run these functions in a PowerShell console with the SharePoint 2010 add-ons loaded:

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
    }
}

You now have two options for using these functions. If you just want to produce a report in the console showing which sites and site collections contain the feature, type the following (note the ReportOnly switch on the end):

Remove-SPFeatureFromContentDB -ContentDB "SharePoint_Content_Portal" -FeatureId "8096285f-1463-42c7-82b7-f745e5bacf29" –ReportOnly

This command will step through all sites and site collections and display the following message whenever it finds the feature specified:

Feature found in site : http://portal/site

If you want to go ahead and remove the feature from all sites and site collections in the content database, type the same command without the ReportOnly switch on the end:

Remove-SPFeatureFromContentDB -ContentDB "SharePoint_Content_Portal" -FeatureId "8096285f-1463-42c7-82b7-f745e5bacf29"

Running this command will step through all sites and site collections, remove the feature specified, and display the following output:

Feature successfully removed from site : http://portal/site

You should now be able to reanalyse the “Missing server side dependencies” issue in the Health Analyzer to clear the problem (providing there are no other issues reported under that title, of course!).

Using CodePlex Solution

There is also a CodePlex solution called SharePoint Feature Administration and Clean Up Tool

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.