1
votes

My development environment is a Windows Server VM running Sharepoint 2010 Enterprise. I've written code to programatically export webparts to XML, for archival or re-import elsewhere.

The issue is that on my development environment webparts consistently export to the new "v3" .webpart format. In our deployment test environment however, the SPLimitedWebPartManager.ExportWebPart method exports any and all webparts (even out of the box Sharepoint webparts) using the older v2 .dwp format. I can tell because the XML contains either the v2 or v3 xmlns namespace. For reasons that are unrelated to this question, the format matters (we need the new v3 format).

The only difference (that I can tell) between environments is my VM is running Enterprise, and the dev deployment environment is running Sharepoint Standard. As far as I can tell, this shouldn't make a difference. According to various documentation I've found, the older v2 format would be used for backward compatibility when older .Net types are used, but in this case the v2 format is used in every case.

I've even tried restoring a site backup to my VM, but still see the same behavior.

Is there any switch or anything at all that would dictate what webpart export format Sharepoint uses?

1

1 Answers

0
votes

We determined that this issue was caused by a tool from Metalogix (Migration Manager) that we're using to migrate old content from a Sharepoint 2003 environment to Sharepoint 2010.

Per Metalogix support:

“The issue that the customer is encountering isn’t an issue with the schema that we are using to create web parts. It’s that in SharePoint 2010 they have completely changed the type of web part used to display list data. In 2007 and earlier, the web part used was “Microsoft.SharePoint.WebPartPages.ListViewWebPart” which happens to serialize itself using the V2 web part schema. While this web part type still exists in SharePoint 2010, it has switched to using “Metalogix.SharePoint.WebPartPages.XsltListViewWebPart” which looks almost identical to the old ListViewWebPart but works fundamentally differently under the hood (and also serializes itself using the new V3 web part schema).

At the moment we do not have any kind of automatic upgrade from ListViewWebParts to XsltListViewWebParts. This means that if you copy list view web parts from 2007 to 2010 the web parts created will be the old style web parts. Any new web parts that the user creates on the target site will, of course, but of the new type.”

According to the developer response, Migration Manager for SharePoint 2010 currently does not upgrade ListViewWebParts to XsltListViewWebParts.

We implemented a workaround to convert exported web parts from the old .dwp format to the new .webpart format.