1

I have a site collection scoped feature that deployed a web part in my site collection, and I am trying to remove them. If I run "stsadm -o enumallwebs -includefeatures" I see that the feature is active at the root level of the web which is odd, since the feature isnt web scoped. Second, if I try to use the stsadm command to deactivate the feature, it says the feature is not active at that scope. I go into site settings and go to the site collection level settings I see that the feature is not actually active. However, when I try to uninstall the feature, I get the message saying that its still active somewhere.

Do I have to remove the webpart from the gallery and remove all instances of it before I can uninstall the feature?

Thanks in advance.

So, what was going on was the feature was originally installed as a web scoped feature (why, ill never know) and was later on reinstalled as a site scoped feature. So, what I ended up doing was forcing an uninstall of the feature, going to the feature.xml file and changing the scope and reinstalling it was a web scoped feature. I can now deactivate and uninstall it.

Thanks to pigeon for suggesting the tool, it showed me something weird that I had to investigate. The features in the site settings were currently set to deactivated, so i found the feature using the tool and asked it to find where the feature is activated. It said that it was a web scoped feature and activated at the root web. So, i rescoped the feature and reinstalled it and blammo! Right there where the tool said it would be.

4 Answers 4

0

FeatureAdmin is handy when it works, I managed to remove some faulty features with it;

http://featureadmin.codeplex.com/

1
  • This got me on the right track. Ill post an edit.
    – user5907
    Jan 13, 2012 at 16:26
1

You can force a removal of a feature using the -force flag in the stsadm deactivate command.

See the MSDN article on the feature: http://technet.microsoft.com/en-us/library/cc262680(office.12).aspx

The web part may still appear in the web part gallery, you have to remove the reference manually after the feature has been removed.

1
  • Tried that, it still says the feature is not activated at that scope.
    – user5907
    Jan 13, 2012 at 15:30
1

Cleaning It Up The Right Way

Cleaning this up the right way is simple and we need to deactivate the feature for each scope that we activated it for.

stsadm –o deactivatefeature –id fb9375d5-07ae-4835-b64c-83441c806691 -url http://test-1 -force
stsadm –o uninstallfeature –id fb9375d5-07ae-4835-b64c-83441c806691 -force

This will remove the entries from the configuration database and remove the entries from the file system in a supported manner.

Now, we are retracting the solution from the web application and then deleting the solution from the solution store

stsadm -o retractsolution -name featuretester.wsp -immediate -url http://test-1
stsadm -o exeadmsvcjobs
stsadm -o deletesolution -name featuretester.wsp

SharePoint 2010 has all these great PowerShell cmdlets! Yes, that’s true, there are a ton of new PowerShell cmdlets that give you even greater flexibility for managing SharePoint. But the simple design fact remains that you still have to explicitly deactivate the feature at the specified scope using the cmdlet Disable-SPFeature. Once the feature has been deactivated at the given scope, you can use the new PowerShell cmdlet Remove-SPSolution that collapses the minimum of 3 separate stsadm commands into 1 single PowerShell cmdlet that removes the solution from the solution store.

1
  • Agree with this. I managed to remove some 'hidden' features that flagged an inplace upgrade I did to fail. The logs are quite handy at telling you exactly where the feature is. I deactivated all the features (it was the same one scattered around the web apps about 30 times) and then uninstalled it. Re-ran the upgrade with psconfig and it reported the upgrade completed successfully .
    – pigeon
    Jan 16, 2012 at 8:06
0

Your scenario sounds to me like a case where the deployment of the solution failed due to some reason which than left the features in an inconsitent state. If so, you can correct that by retracting the solution package locally on all servers in the farm with (if it contains web application resources):

stsadm -o retractsolution -name some.wsp -local -url http://someurl

This does the necessary clean-up so that you afterwards can add and deploy the solution normally.

Your Answer

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