zondag 6 juni 2010

Saving and restoring sites using WSP templates in SharePoint 2010

As you probably already know, stp files are not used anymore in SharePoint 2010. The extension which was used for site templates in SharePoint 2010 has been replaced by WSP files.

In this article I will quickly show you how to work with these kinds of backup files. First of all, don't bother using this technique on publishing sites. You will not have the option (via the GUI) to save the site as a template. I did not test it for all other site templates though. This article is based on a team site template.

If you still want to create WSP files from publishing sites, use the following URL extension: '_layouts/savetmpl.aspx'.

1. Create the WSP backup In your site settings, click on "Save site as template" under "Site actions". Enter a file name, a template name and choose to include or not include site contents. The process that follows will generate the WSP file which can be found in the Solution Gallery. The link to this gallery is provided to you after the WSP has been created. Download the file.

2. Create a new site sollection for this template Now, again in Central Administration, go to 'Application Management' and create a new site collection. As template, select 'Custom' and then 'Select template later ...'. Once created, visit the new site collection. Because there is not yet a default page, SharePoint will present you with a page where you can select the template for this site collection. Select 'Solution Gallery'.

3. Deploy the downloaded template WSP file With the stsadm tool or Powershell, deploy the solution package. For stsadm the command would be: stsadm -o addsolution -filename [path to you wsp file] The solution you just added to the system is a farm solution. So in Central Administration, go to 'System Settings' - 'Manage farm solutions'. Select your WSP and deploy it. In your new site collection, go to the site collection features by adding this to your URL: '/_layouts/ManageFeatures.aspx?Scope=Site'. Activate the template feature you just deployed.

4. Restore the backup Create your new site via the 'create new site' interface and choose your imported site template from the custom tab

Geen opmerkingen:

Een reactie posten