How to Resolve SharePoint Server Dependencies Problems
I - Context
After upgrade or operations on SharePoint Databases or Contents Databases, you can get problems reported by SharePoint Analyzer. The Analyzer can report integrity problem between installation files and data in SQL databases.
For example, you uninstall a SharePoint farm solution and an problem cause the data in content databases are not deleted but the farm solution is uninstall. It's causing integrity problem but you SharePoint farm work. This guide give some methods to resolve these integrity problems.
note: Please backup your contents databases before all operations!
II - Use Database SQL query to resolve problems
To use this method you need:
- SQL management studio tool
- Sharepoint central administration access ( SharePoint Farm Global Administrator Account )
a) MissingSetupFile
**
**
In the SharePoint Analizer, if you have missingsetupfile error, you have got link to this setup file. You need to use this link to execute SQL query in content database. Copy this link and replace in this SQL query. Execute this query to get setupFile id.
select * from AllDocs
where SetupPath like '%-File link here-%'
This query returns all references of this feature in your content database, you just need to copy the feature id like that
Now, you need to delete this database reference with this query.Replace "file id here" by id returned by the last query.
delete from AllDocs where id = '-File Id Here-'
You need to execute DELETE query for all returned feature id.
b) MissingFeature
To resolve this kind of problems, it's the same procedure as MissingSetupFile. But just a different query. Execute the query below to get feature id:
select *
from features
join webs on (features.webid = webs.id)
where featureid = '-Feature Id here-'
After, copy this feature id and execute delete query
delete from AllDocs where id = '-Feature Id Here-'
c)MissingAssembly
Copy assembly missing link from error message in SharePoint integrity analizer and replace in this query
SELECT *
from EventReceivers event
join webs on (event.webid = webs.id)
join sites site on (site.id = event.siteid)
where Assembly = ‘-Assembly link-'
Copy id and execute delete query
delete from AllDocs where id = '-Assembly Id Here-'
d)MissingSiteDefinition
Copy template id from error message and execute this query to select database id
select *
from webs
where webtemplate = 'Template id here'
Now, execute delete query
delete from AllDocs where id = '-Template Id Here-'
e)MissingWebPart
Copy the missing id webpart from error message and replate in this query
select *
from AllWebParts webpart
join alldocs doc on (webpart.tp_PageUrlID = doc.ID)
join sites site on (site.id = webpart.tp_siteid)
where tp_WebPartTypeId = ‘webpart id’
Get the webpart id's and execute delete query
delete from AllDocs where id = '-webpart Id Here-'
III - Use tool to resolve problems
PowerShell Solution
Application Solution - Feature admin cleanup tool