SharePoint 2010: Site exporting as WSP solution (Part 1)

Note: this blog post is based onexperiences with the SharePoint 2010 Technical Preview version.

In the good old days of SharePoint 2003 and 2007 it was possible to save a site as a template. These sites were saved as .stp files, I assume this acronym stands for SiteTemPlate, a non-documented closed format that did not allow for modification in the saved template files. so new sites could be created based on the template. SharePoint 2010 promises the possibility to save a site as a WSP package, the Windows SharePoint Services Package format that we all love in the development of our SharePoint solutions, because it promises seamless deployments through the farm.

In this series of blog posts I will investigate the power of this new functionality, and take you, the reader, along the way in trying to answer the following questions that directly pop up into my mind:

  • Is the site really exported as a WSP? And how does it look like at the inside?
  • If we create a new site based on the template, do changes to content types at the site collection level propagate to the content types in the new instance of the site template?
  • In Moss2007 it was not possible to export a publishing site as a site template. Well, actually you could, but it was not supported. Probably because pages and content a site publishing site depends on, like master pages, pages layouts, the style library and site collection images are managed at the site collection level (in the root site of the site collection). Did this change in 2010, and how is it handled?
  • What is exported. The complete configuration of the site, or only changes to the site with respect to the initial site definition?
  • Can we learn some new stuff on authoring WSP’s from the generated WSP’s?
  • Visual Studio SharePoint Support has a project type “Import SharePoint Solution Package”, what does that do? Can we use the WSP generated by a saved site template?

Ok, let get started. The first steps to execute are:

  • Create a site based on the blank site definition
  • Export the site

To showcase some of the new tools in the mean time I will use SharePoint Designer to create our new site:

  1. Connect to the portal, and select the Subsites tab
    image
  2. Create a new site named wspexport based on the Blank Site template
    image
  3. This brings us a blank site:
    image
    To inspect some of the export functionality we create a custom list MyList with a Title and Description field, and a document library MyDocuments. We put some entries in the custom list and add a document to the document library. I assume that everyone knowing something about SharePoint knows how to do this.

    Adding a simple Dummy.txt document to the document library:
    image

    The home page after adding list view web parts for the MyDocuments and MyList:
    image 
  4. We go back to SharePoint Designer, set the site Title and Description of the site and save as template
    image
  5. Selecting Save as template brings you to the web site where you can specify the template site settings
    image 

    When save as template is done we get to the following screen:
    image
  6. Following the user solution gallery will bring us to the Solution Gallery. This is a location where solutions can be uploaded and downloaded. These solutions can probably be solutions that can include code that will be run in a sandbox. More on this in an upcomming blog post.
    image
  7. Right-click on the WspExportSite and select Save Target As… to save the WSP file to your location of choice.
  8. Note that the saved solution can be activated by selecting the arrow next to its name
    image

This concludes the first post in this series. What do we have:

  • A WSP file on disk based on Blank Site containing a list and a document library
  • A solution in our solution gallery ready to be activated

Disclaimer: All information in this blog post is based on my personal interpretation of information collected at the SharePoint Conference 2009 and experiences with SharePoint 2010 Technical Preview version provided to my company in the PEP program.

23 Comments

  • Thanks for this -- was having a heck of time provisioning the taxonomy picker field. This solved it :)

  • Its worth noting that to apply a user solution to an entire site collection you can create the site collection and specify the option under the custom tab. Then when you go to the new (blank) site collection it prompts you to choose a template and it gives the option to go to the User Solution gallery from there.

  • Am really interested on getting answers to the questions you pose at the top of Part 1.

  • Thanks stlawrence ! Your comment helped me solve my problem... :)

  • Great guide and thanks.
    What happened to part 2?

    N03L

  • I have create a team site and i made it as a template, so i want to use this in other web application. I have uploaded the webpart file in new web application and activated. so it shows n custom list but its not creating. It shows me the error "please activate the following feature with id ace40691-oof3-4960-a402-cfe90ee86ce5 activated in site collection"
    help me on this..

  • I agree, Part 2 would be really helpful. Specifically, how to take advantage of that Upgrade button in the ribbon :-)

  • What about the Answer of the Question you mentioned above : "In Moss2007 it was not possible to export a publishing site as a site template. Well, actually you could, but it was not supported. Probably because pages and content a site publishing site depends on, like master pages, pages layouts, the style library and site collection images are managed at the site collection level (in the root site of the site collection). Did this change in 2010, and how is it handled? "

  • Hello , Nice Post, I have one dought if my site having no of lists and each list having lookups in that case the lookups lists will work.. Importing and exporting as WSP solution.

  • h4Fvgo I truly appreciate this article post.Thanks Again. Much obliged.

  • That is the proper weblog for anyone who wants to search out out about this topic. You realize a lot its nearly arduous to argue with you (not that I really would need…HaHa). You definitely put a brand new spin on a topic thats been written about for years. Great stuff, simply great!

  • hrfKcP This is one awesome article post.Really looking forward to read more. Cool.

  • Its nearly impossible to lookup out knowledgeable folks about this topic, conversely that the truth is sound something
    like do you recognize what youre dealing with!
    Thanks

  • Up to now, you require to term of hire an absolute truck or van and will also be removal equipments
    to valuable items plus check out the new destination. From the long run, which end up with are few things except anxiety moreover stress and anxiety.
    removals stockport

  • I envy your piece of work, thanks for all that the useful blog posts.

  • There’s no doubt that, if that they have been not
    to that the restricts, next lifetime won't cap one to take part in the boundary.

  • I something like that the efforts you have put
    in this, thankyou for all that the great posts .

  • When visiting web pages, i always look for a very nice content just like yours .

  • articulo agregado a favoritos, lo imprimiré cuando llegue a la oficina.

  • Whats demanding now is how that the systematic appearance to ones life is just not changed.

    This may sound out of line? It can be nearly as if we crawl through life
    with our eyes closed on, not understanding the
    true meaning of our own destiny.

  • I used to be born on a Friday, conversely not last Friday.

  • If you have just set up a page for your corporation, then it's time you do something about that the �likes�. Via that the internet Faxing

  • Hello! Someone in my Facebook group shared this site
    with us so I came to look it over. I’m definitely enjoying that the information.
    I’m book-marking and will be tweeting this to my followers!
    Outstanding blog and superb style and design.

Comments have been disabled for this content.