13 November, 2012

Importing SharePoint 2007 list templates (STP) into SharePoint 2010 - Product version 3 to 4 ˆ⌣ˆ


I've been working on migrating 3 portal MOSS 2007 (SharePoint Server 2007) customisation to a new WSS 3.0 (SharePoint Server 2010) environment today. My predecessor relied on list templates stored in STP files to deploy the custom list templates and create some lists instances based on them.
(This deployment involved manual uploading; creating of lists)
Now, while STP site templates are no longer supported, STP list templates should still work in SharePoint 2010. Unfortunately things were a bit trickier than I expected them to be.
As a test I started with uploading one of the original STP's to the template catalog (_catalogs/lt). No problem so far, but when I tried to create a list based off that template I got the following error:
Error
Microsoft SharePoint Foundation version 3 templates are not supported in this version of the product
Correlation ID: {random guid}
Date and Time: ....
 
Wheew, that didn't look to good. Fortunately after Googling around I found out 1 great article than another blog that say they all suggested on installing the original solution in a 2007 environment, upgrading the environment to 2010; then exporting the list again as a template.
 
This article guide me to delve deeper into the STP file. As you might know, these STP files are just renamed CAB files. This means you can safely rename them again to .CAB and extract their contents ... which I did.
 
Doing so revealed that my STP/CAB file only contained a single file: manifest.xml. This file contains the definition of your list: its fields, contenttypes, views, etc ...
To have some data to compare to, I created a new, custom list in SPF2010 and exported it as an STP template. Once again I renamed the file to .CAB and viewed its contents ... and there was much rejoicing.
 
It turned out that the MOSS 2007 STP had the same content as the WSS 3.0 STP: just a single manifest.xml. A quick diff between the two manifest.xml files revealed that they're both quite similar and that there's a ProductVersion element in both files.
In the MOSS 2007 version, this element has a value of 3 ... but in the WSS 3.0 version, it has a value of 4. Could it be solved this easily?
 
Guess it was. I changed the value of the ProductVersion element in the original manifest.xml to 4 and repackaged it into a CAB. Renamed the CAB to STP and uploaded it again in WSS 3.0 and behold ... no more errors when creating lists from that template!
 
Summary
So if you need to migrate list templates STP's from MOSS 2007 (SharePoint Server 2007) to WSS 3.0 (SharePoint Server 2010), you could try the following way ;). Here we go :
  
  1. Rename the original .STP to .CAB
  2. Extract its manifest.xml to a local folder (lets call it {workingfolder})
  3. Search for the ProductVersion element. This should have a value of 3
  4. Change its value to 4
  5. Repackage the manifest.xml into a .CAB. I've done this by using makecab.exe in the C:\Windows\System32 folder
    * NOTE : Use cd.. command in command prompt to up to 1 directory level, use cd\ to up to highest directory level.
    Syntax: makecab.exe {workingfolder}\manifest.xml {workingfolder}\{template-name}.cab
    ** Note : Use "workinf folder" if thre's space of your folder name.
  6. Change the generated cabinet's extension from .CAB back to .STP and upload it into the _catalogs/lt
Update :
For those looking to migrate a 2007 doc lib with content: apparently a fellow SharePoint-victim has written a powershell script for this - http://www.heyweb.net/2011/06/converting-sharepoint-2007-document-library-templates-for-sharepoint-2010/
 
Source : http://tom-dw.blogspot.com/2010/06/importing-sharepoint-2007-list.html
 
This article save my day ^^
Rinardi Adinegara Barlim Ms SharePoint System Developer

God's partner that full of love in his life. Enjoy his life by distributed bless to another people that he meet. Now work as Microsoft SharePoint Developer :)

Tidak ada komentar :

Blog Stat