Moving a list template from MOSS 2007 to SharePoint 2010


In SharePoint 2010 site templates are all .wsp files. They are solutions that need to be activated.So, you can’t migrate a site template (.stp) from MOSS 2007 to SharePoint2010 directly. The list templates however are still .stp files in SharePoint 2010. Given that, you should be able to use the templates that were saved in MOSS 2007 right? When you actually try to do it, you get the error "Microsoft SharePoint Foundation Version 3 templates are not supported in this version of the Product."
The work around:
.stp files are essentially CAB files. A list template (stp) contains a manifest.xml file and a few more files with numeric names which are your list pages. It is the manifest.xml file that contains the <ProductVersion> tag which specifies the version of the product.In order to get the stp working on SharePoint 2010, I followed the steps below.
1. Rename the .stp as .cab
2. Extract the contents of the .cab (I use 7zip for this)
3. Open manifest.xml in an editor.
4. Change the value of <ProductVersion> tag from 3 to 4 and save the file.
5. Repackage the files into a CAB. Now wait there! How do we repackage it? You can write a DDF, run makecab.exe. I would rather use the CAB project of Visual Studio. Its simple – Open a new cab project, add the file and build you are done.
6. Rename the file to .stp and you are ready to go!

Advertisements