Issue with upgrading the web part pages created from the custom web part page template from SPS 2003 and MOSS 2007

Once I had worked with a case in which customer has created a custom web part page template in SPS 2003 as per the following MSDN article https://msdn.microsoft.com/en-us/library/dd583147.aspx. When customer upgraded from SPS 2003 to MOSS 2007 he found that the web part pages created in SPS 2003 based on the custom web part page templates are not upgraded correctly to MOSS 2007.

Their look and feel in MOSS 2007 is not similar to SPS 2003. As the issue is with the web part pages created from the custom web part page template we need to ensure that whether the mapping of custom web part page template is done correctly. Checked the Server under 12 hive whether custom web part page templates are available in MOSS 2007. The custom web part page templates are in place. Checked the Mapping file to verify whether the mapping of custom web part page template between SPS 2003 and MOSS 2007 is correct. The mapping is accurate between 60 hive and 12 hive of custom web part page templates.

Checked the “Docs” table in the MOSS 2007 content database to verify whether the set up path of the web part pages created from custom web part page template are accurate. But the “SetUpPath” column in the MOSS content database is NULL for the web part pages created from the custom web part page template. When we updated the “SetUpPath” column then the look and feel of this problematic pages are fixed as expected. As we cannot directly modify the database table checked with the SharePoint API to update this column in the database. But the “vti_SetupPath” property in the SPFile property bag is read only and we are unable to update its value using API. So decided to export t the web part pages created from the OOB web part page template to check the manifest.xml of this page. Then exported the web part pages created from the custom web part page template and checked the Manifest.xml. We found that the “vti_SetupPath” property is not set in the manifest.xml of the web part pages created from the custom web part page template. Decided to set this property in the manifest.xml and import it again to the web part pages library.

Following are the changes need to be done in the manifest.xml file of the affected web part pages after the export.

  1.   Within the SharePoint list, get the list of items [Created using custom web part page template. Export all the list items using SharePoint Object model. Though we can use stsadm command, its scope is restricted to web site only. We are looking at list / list item levels.
  2. Once Export is successfully completed, delete the list items in the list [Those files which got exported]
  3. On Export, we get content migration package [This package gets stored in the location that we specify in the code ].
  4. The package consists of Manifest.XML file. The xml file has the following tag.

 

<SPObject Id="23576837-bc5a-433f-9e38-93ba255dbb27" ObjectType="SPFile" ParentId="f95f1bdf-4459-4edf-8c3f-79820d73abd0"

 

                  ParentWebId="c93ce050-2346-4b0c-ab65-e997d5b326e3"

                  ParentWebUrl="/sites/Chandru"

                  Url="/sites/Chandru/Shared Documents/sowmyan6.aspx">

 

            <File Url="Shared Documents/sowmyan6.aspx" Id="23576837-bc5a-433f-9e38-93ba255dbb27" ParentWebId="c93ce050-2346-4b0c-ab65-e997d5b326e3" ParentWebUrl="/sites/Chandru" Name="sowmyan6.aspx" ListItemIntId="36" ListId="b51a6865-d9a8-41a5-b467-e00ab4d781d0" ParentId="f95f1bdf-4459-4edf-8c3f-79820d73abd0" TimeCreated="2009-04-09T20:32:16" TimeLastModified="2009-04-09T20:32:44" Version="1.0" IsGhosted="true" SetupPath="1033\STS\doctemp\smartpgs\spstd7.aspx" SetupPathVersion="3" SetupPathUser="1073741823" FileValue="00000000.dat" Author="1073741823" ModifiedBy="1073741823">

                  <Properties>

                        <Property Name="vti_metatags" Type="StringVector" Access="ReadOnly" Value="GENERATOR Microsoft\\ SharePoint ProgId SharePoint.WebPartPage.Document HTTP-EQUIV=Content-Type text/html;\\ charset=utf-8 CollaborationServer SharePoint\\ Team\\ Web\\ Site" />

                        <Property Name="vti_cachednolayoutzones" Type="StringVector" Access="ReadOnly" Value="TitleBar" />

                        <Property Name="ContentTypeId" Type="String" Access="ReadWrite" Value="0x01010040A4775A0A71C7478867F9E357CD8475" />

                        <Property Name="vti_generator" Type="String" Access="ReadOnly" Value="Microsoft SharePoint" />

                        <Property Name="vti_cachedhastheme" Type="Boolean" Access="ReadOnly" Value="false" />

                        <Property Name="vti_cachednoperszones" Type="StringVector" Access="ReadOnly" Value="TitleBar" />

                        <Property Name="vti_cachedneedsrewrite" Type="Boolean" Access="ReadOnly" Value="false" />

                        <Property Name="vti_cachedzones" Type="StringVector" Access="ReadOnly" Value="TitleBar LeftColumn Header TopRow CenterLeftColumn CenterColumn CenterRightColumn Footer" />

                        <Property Name="vti_charset" Type="String" Access="ReadOnly" Value="utf-8" />

                        <Property Name="vti_parserversion" Type="String" Access="ReadOnly" Value="12.0.0.6335" />

                        <Property Name="ContentType" Type="String" Access="ReadWrite" Value="Document" />

                  </Properties>

                  <WebParts>

                        <WebPart Name="110ee2a6-d028-4d90-bbc1-bc19c8f885aa" AllUsersProperties="AQUAAAACKgBJACkAAz4AAAIqAEoAKQADPQAAAVUAYgAD//8bL19sYXlvdXRzL2ltYWdlcy93cGljb24uZ2lmDwFTAGIAA///BHRlc3QPDw==" Level="major" WebPartZoneID="TitleBar" WebPartTypeId="94e9c166-264a-f84b-2377-bccefb8b3771" IsIncluded="true" WebPartOrder="1" FrameState="0" />

                  </WebParts>

                  <Links>

                        <Link TargetId="d6f83029-a908-406f-981a-a93fdfcb618e" TargetUrl="/_layouts/images/blank.gif" IsDirty="false" />

                  </Links>

            </File>

 

      </SPObject>

5. Do the above highlighted modifications (Add/Edit) in the manifest.xml file.

6. Now, run the import code. [ Make sure that those files from SharePoint library are deleted before import is run. Otherwise, the files  won’t be over written ].

7. On successful import, the list item will now point to the correct template [As the setuppath of that item is rightly set]