STP2WSP File Converter, Part 1: The Anatomy of A .STP

Recently, together with my colleague Martin Schmidt, I gave a session on MOSS 2007 to SharePoint 2010 migration. Among other things I mentioned that the site template .STP files are no longer supported in SharePoint 2010. STP files are still supported for list templates, though.

From my professional experience I know that there are many people who have a lot of site templates in .STP format and they don’t want to lose their work. Microsoft suggests that the right way is to create a site with each template, upgrade to SP2010 and then save as WSP template in the new version. It’s an overkill, if you ask me.

My goal is to create a converter written in .NET that would crack open an STP site template and write a shiny new WSP file with the same structure. You will follow my journey in the following days.

An .STP Site Template

Let’s create a normal site, with blank site template. I will add a document library and a webpart to expose the library on the default site page.

image

Now, save it as a STP file by going to Site Settings / Save Site as Template option.

image

The template is now safe in the Site Template Gallery in the root of the site collection.

image

Prying the Lid Off

Let’s download the STP file and extract its contents with the Microsoft Cabinet SDK Tools.

image

In this case it’s only a single manifest.xml file. A quick inspection reveals that it has the site template header and a site definition metadata.

image

Opening SharePoint Manager 2007 to inspect the source web raw properties, we see that there is a clear mapping between the <MetaKey> tags and the site property bag:

image

Furthermore, the manifest.xml file keeps reference to the original site definition (in this case, “Blank site”) from which the original site is created.

STP Manifest.xml 12TEMPLATE1033XMLWEBTEMP.XML
image image
Note the TemplateID and Configuration attributes Note the ID attribute of the Template tag and the ID attribute of the Configuration

I’ll keep investigating. The rest of the story, in Part 2, soon.

My New Blog in Spanish: SPEdinKapic.Blog

I’ve decided to write a new blog, in parallel with this one, with the Spanish-speaking SharePoint audience in mind. As I work in Barcelona (Spain), there are many readers of this blog that come from there and I believe that a localised content for them is a good thing. What I don’t know is which blog is going to be my “primary” blog. Only time will show it.

image

The URL of my “other” blog is http://spblogedin.blogspot.com

¡Bienvenidos!

Bienvenidos a mi “otro” blog

Edin_Kapic Por fin me he decidido a hacer un blog en español sobre mi experiencia con SharePoint. Varias razones me han llevado a ello, entre otras la intención de ser más cercano a los lectores hispanohablantes de mi blog existente en inglés.

Para los que no me conozcan, me presento brevemente. Me llamo Edin Kapić (sí, el último carácter de mi apellido es raro, no es una errata. Soy bosnio-herzegovino en realidad.). Llevo desde el año 2005 peleándome con SharePoint (desde su encarnación v2) y más aún con .NET (y antes con VB4, VB5 y VB6).

Trabajo en una consultoría especializada en tecnologías Microsoft llamada pasiona consulting, Gold Certified Partner de Microsoft, con sede en Barcelona. Modero el foro oficial de desarrollo en SharePoint de MSDN España y colaboro en el Community Kit for SharePoint, cuando mi tiempo libre (libre?!) me lo permite.

Hasta ahora tenía sólo un blog en inglés, llamado Res Cogitans (por la frase del filósofo Descartes), pero a partir de hoy tengo la intención de añadirle este nuevo vástago, en la lengua de Cervantes. Intentaré publicar cosas interesantes en los dos blogs y veré a dónde me llevará el camino.

Espero que vuestra visita a mi blog sea provechosa y os dé momentos de lectura interesante y útil. Es un pequeño detalle para devolver tantos momentos que otros blogs me han dado.

My SPC 2009 Coverage Article at DotNetMania November Issue

I wrote a short article in Spanish .NET magazine called DotNetManía about the SharePoint Conference 2009 in Las Vegas. I’ve just found out that the PDF file of the article is available online at their site:

http://www.dotnetmania.com/articulos/dnm064/pdf/dnm06402.pdf

(of course, it’s in Spanish only) 😉