Thursday, 5 March 2015

Diagnose and Clean MissingWebPart and MissingAssembly issues

Hi all,

Today I found useful cmdlets to diagnose and clear those errors in the Content DB of my SharePoint 2010 Farm.


How to:

Step 1:
 - Test-SPContentDatabase -name <ContentDB_Name> -webapplication <Web App URL>

Step 2:
 - Select the WebPart Class GUID

Step 3:
 - Run this command with the related WebPart Class GUID:

Run-SQLQuery -SqlServer "SRV_DATABASE" -SqlDatabase "SharePoint_Content_sharepoint_db_name" -SqlQuery "SELECT * from AllDocs inner join AllWebParts on AllDocs.Id = AllWebParts.tp_PageUrlID where AllWebParts.tp_WebPartTypeID = '9812863c-ee62-dab6-57f5-79e9d4d36022'" | select Id, SiteId, DirName, LeafName, WebId, ListId, tp_ZoneID, tp_DisplayName | Format-List

Step 4:
 - The result will give the below info:

Id                            : a5da7b36-083f-4d07-b50b-8f1fc8d7bbe9
SiteId                      : 53061278-8b1d-4d6d-9dce-8568f90c5574
DirName                 : Sites/blahblasite/Sandbox/TestWSServiceLevelDashboard
LeafName               : default.aspx
WebId                     : 2ab691b1-0d74-4bf2-9524-c6b1d969cfac
ListId                      :
tp_ZoneID              : Left
tp_DisplayName     :


 - The URL to use is:                http://shareppoint.contoso.com/Sites/blahblahsite/Sandbox/TestWSServiceLevelDashboard/default.aspx?contents=1

 - So, here are the steps that I follow to remove the “ErrorWebPart”:
     1- select the Error rows
     2- click on “Close” to set them as “No” for the “Open on Page?” column
     3- select the same Error rows then Delete them



Step 5:
 - Execute again the “Test-SPContentDatabase” to check that all entries for the MissingWebPart are gone.


Thanks all folks

No comments:

Post a Comment