Friday, March 29, 2013

Migrating SharePoint 2007 Site/List Templates(.stp) into SharePoint 2010

Unfortunately, SharePoint 2007 site templates(.stp) can't be used as in SharePoint 2010. Hmm... Then what to do with the custom SharePoint 2007 Site templates? Can't I use them in SharePoint 2010? well, You can, Here is the work around:
  1. Create a site in SharePoint 2007 using the custom .stp template.
  2. Migrate that site to SharePoint 2010 by either In-Place or Database attach method (backup the database for that site from SQL Server for SharePoint 2007 and restore it on SharePoint 2010's SQL Server, then atach the DB(stsadm -o addcontentdb) to SharePoint 2010)
  3. After you do that just Open up the site and fix any issues (like file system references).
  4. Once upgraded to SharePoint 2010, follow these steps:
  5. Click on Site Actions >> Site Settings.
  • On the Site Settings page click "Save site as Template", then enter a file name and Template name and click OK.
  • Now, The site template is saved as a WSP file to the Solutions Gallery for that site collection. This solution can then be re-used as a Site Template.

open the .wsp solution in Visual studio 2010, change the Scope to “Farm” and re-deploy, if you want this site template to be available at the farm level.

Important: When saving site as a template enable "Include Content" check box! otherwise you may end up in Error "Exception from HRESULT: 0x81070905" when creating sites from the particular template.

Migrating List Templates from MOSS 2007 to SharePoint 2010
Likewise, List templates created in MOSS 2007 can't be used in SharePoint 2010. You will get this error when you try to create a list based on MOSS 2007's List template:

Error: Microsoft SharePoint Foundation version 3 templates are not supported in this version of the product!


Fortunately, There is a work around. We can use the same method as above. Or if its just a list template, we can use the below trick:
  1. Download the .STP file from the site, and Rename .STP to .CAB
  2. Extract the manifest.xml
  3. In "ProductVersion" element, Change its value to from "3" to "4"
  4. Repackage the manifest.xml into a .CAB. makecab.exe c:\manifest.xml c:\template.cab
  5. Rename the .cab file from .CAB to .STP and upload it into the List templates (_catalogs/lt)
Here is a scripted way: http://www.heyweb.net/2011/06/converting-sharepoint-2007-document-library-templates-for-sharepoint-2010/

No comments:

Post a Comment