Find all References of a Webpart on Pages
Hello
We have developed a custom webpart and deployed this to our farm. Now we need to know where this webpart is referenced (not webs, Webpages).
On a website I found the way with digging direclty in the content database with this TSQL
USE [contentDatabaseName]
SELECT DirName,LeafName FROM dbo.AllDocs WHERE id IN
(SELECT tp_PageUrlID FROM dbo.WebParts WHERE
(tp_WebPartTypeID='dcdbbbd0-8dd6-1ecb-a3b2-12d30061d482')
OR (tp_WebPartTypeID='d5101cfe-e315-c578-cd06-1966f283e3ed')
OR (tp_WebPartTypeID='602e7431-ac3e-75b9-c8e0-57533bdab161')
http://blog.uvm.edu/jgm/2010/08/25/preparing-the-sharepoint-2007wss3-database-for-upgrade/
The problem I have is how to get the tp_WebPartTypeID when I only have the Feature/Solution GUID.
Is there somewhere the Content Database Schema Diagram of MOSS 2007 available?
Thanx.
March 14th, 2011 11:31am
Hi Murratore,
I'm not much of a SQL expert, so I'm not sure if this'll be much use for you but please take a look at this
http://vspug.com/ethan/2007/09/16/inspecting-the-sharepoint-content-database/
Please keep in mind the warning at the start of the blog though, updating the databases directly violates the licensing.
Hope that helps.http://www.final-exodus.net
Free Windows Admin Tool Kit Click here and download it now
March 14th, 2011 12:39pm
I know this Blogpost. But there is nothing mentioned about Webparts.
March 15th, 2011 6:18am
If you have the webpart applied to a page, open the page in SharePoint Designer, select the webpart on the webpart page and you will see the webpartID on the left under "Tag Properties" tab.
Free Windows Admin Tool Kit Click here and download it now
March 15th, 2011 11:28am
another way is to create a custom program which will loop through all pages in all sites recursively and check web parts occurience on the page. It will be much more reliable and standard way to do ti.Blog - http://sadomovalex.blogspot.com
CAML via C# - http://camlex.codeplex.com
March 15th, 2011 11:59am
another way is to create a custom program which will loop through all pages in all sites recursively and check web parts occurience on the page. It will be much more reliable and standard way to do ti.
Blog - http://sadomovalex.blogspot.com
CAML via C# - http://camlex.codeplex.com
Moderator Note: I have deleted the SP 2010 post (from someone else - not sadomovalex) which followed this post in the thread. SP 2010 information is completely off-topic in the pre-SP 2010 forums. Save your SP 2010 questions and answers for the SP
2010 forums.
Free Windows Admin Tool Kit Click here and download it now
March 15th, 2011 6:58pm
Hi there,
If you are using this to migrate from SharePoint 2007 to SharePoint 2010. then please follow below steps and then get the web part type id. I used these steps to get the compete report on which pages my web part is referenced.
Take the backup of your content database. Move it to the SharePoint 2010 database server. Restore it on the Sql Server. Create an empty site[blank site] in SharePoint 2010. Open SharePoint powershell script and then type Test-SPContentDatabase -name SharePoint_Content_Intranet -Webapplication http://sp2010-02:7777
Note: Remember, in the above line the web application url is what you have created a blank site in 2010 environment and name is the content database name.
This lists all information about what are missing on the 2010 server. If your webpart is not there in the sharepoint 2010 server then it lists as shown below.
Category
: MissingWebPart
Error
: True
UpgradeBlocking : False
Message
: WebPart class [d4321bbd-3f43-e3f5-4a38-97d4359facd1] is referenced [31] times in the database [SharePoint_Content_Intranet], 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 [SharePoint_Content_Intranet], but are not installed on the current farm. Please install any feature or solution which contains these web parts.
Where the text highlighted in bold is your web part type id. Use that and then execute your query to get all references. Good luck.
ASP.NET and SharePoint developer
Company: http://www.rampgroup.com/
Blog: http://praveenbattula.blogspot.com
March 23rd, 2011 2:42am