We're migrating from SP2007 to SP2010 and are seeing some error messages about missing web parts during the upgrade, but the error messages only list the GUID and not the web part name. Is there a way to easily get the web part name from a GUID? Maybe a PowerShell command?

Yes I did, cheers. Those admin tasks evade me sometimes... puts head back into sea of C# code
–
James LoveMay 21 '11 at 16:50

Yes, we did run the pre-upgradecheck. There were some missing features, but some of the other problems were web parts that we carried over from SP2003 in the database, but those web parts don't exist in the file system. We're doing some major clean-up now.
–
stomcavageMay 24 '11 at 14:55

To James' point, it sounds like you missed a step or two in your upgrade planning. Make sure you're running Test-SPContentDatabase before you kick off the actual upgrade to avoid those "oh by the way's" along the upgrade process.

Run stsadm -o preupgrade check from 2007 farm

Run Test-SPContentDatabase against the 2007 DB(s) from the new 2010 farm (this will show you what's missing; until this is clean don't proceed with the actual upgrade)

If the GUIDs that Get-SPFeature return do not match those in your errors, it could be that the GUIDs are actually the web part instance IDs. I'm not sure if there's an easy way to resolve this, but I do have a solution (that I'm not keen on publishing) if you're still stuck, even after trying Mike's solution here.
–
James LoveMay 20 '11 at 17:59

This is all good information! However, I'm looking to identify particular Web Parts from the GUID not lists. Any advice?
–
HelmutOct 25 '11 at 20:09

Try this post over on Phil's blog. You can use PowerShell to execute a SQL query to resolve the GUID against a particular feature or page. I've used this approach to identify the pages where the web parts were referenced so they could be removed. get-spscripts.com/2011/08/diagnose-missingwebpart-and.html. The other thing you should check is if the incompatible web parts are still in the web part gallery of any site; that can also throw an error. If you remove them, you must also clear the recycle bin or the references will remain in SQL and still throw the error.
–
webdes03Oct 25 '11 at 22:30

One quick trick (which doesn't quite get you what you want, but will be helpful) is to add "?Contents=1" to the end of the URL for any page. This will show you the /_layouts/spcontnt.aspx page which displays all of the Web Parts which are on the page, including those which are closed. It's often the case that the issues are with closed Web Parts, and you can remove them from this page. (Always a good practice in any case.)

If the issue persists, then you can see the GUIDs for some of the open Web Parts using the Developer Tools in IE7+ or Firebug in Firefox. You can use either tool to inspect the DON and search for the GUID.

Then I've got some bad news for you as the only way to find out the answers for many of these issues is to dive into the content database directly via SQL Server Management Studio. I know, I know, according to MS, you aren't supposed to ever go into the SQL database. Unfortunately, they provide horribly inadequate tools when it comes to the 2007-2010 upgrade which leaves people with very few other options. In order to answer your specific question, you will need to run SQL like this:

(replacing the GUID with the web part type GUID you are looking for of course)

That isn't the exact SQL you will need but should get you started toward finding those missing pieces. A large number of the issues you will hit in the pre-upgrade check can be identified by querying the WebParts and/or the AllDocs tables in some way.

Note: this is just to help you identify the specifics of the issue - do not modify the data in any way.

Per Dave Wise's answer above: Thanks, that worked great. However, even though my SQL Query returned 9000 results, about 18 of the 50 GUIDs are still not in the list. What does that mean? Also, how do I go about identifying features and eventhandlers? Also, a number fo the GUIDs are specified for search, do I have to activiate these in SP2010 or do they come standard with Search Services?
–
HelmutNov 1 '11 at 17:08