Deploy authored site elements (SharePoint Foundation 2010)
Applies to: SharePoint Foundation 2010
This article discusses the deployment of authored site element customizations in Microsoft SharePoint Foundation 2010, including deployment procedures, general considerations, and best practices related to deploying custom content.
In this article:
About deploying authored site elements
Before you begin
Deploy content by using the Content Migration API
Create a content deployment package by using Windows PowerShell
About deploying authored site elements
Authored site elements can be thought of as the "content" in your sites. They are the Web pages, images, layout pages, cascading style sheets, and other resources that compose your SharePoint Foundation 2010 Web site. Authored site elements include:
**Artifacts **These are site elements — typically authored by using a design tool such as Microsoft SharePoint Designer 2010 — that compose the framework in which your site's content appears. Examples of artifacts include master pages and layouts.
**Web content **These are site elements — typically authored directly in the Web browser or in a client authoring program such as Word 2010 — that supply the content of your site. Examples of Web content include Web pages and images.
This article does not discuss deployment of developed site elements such as Web Parts and other code. For more information, see Deploy solution packages (SharePoint Foundation 2010) and Deploy site elements by using Features (SharePoint Foundation 2010).
Authored site elements can be deployed by various methods:
Use the object model to handle scenarios such as writing scripts to automate common tasks and setting custom properties for export and import that tailor the deployment. The object model provides the most control over your data migration scenarios.
Content deployment packages are intended for a one-time move or migration of content to a destination site collection. Content deployment packages are CAB files that can contain part or all of the authored site elements in a Web site, and can be deployed in a disconnected environment. Windows PowerShell cmdlets are used to create content deployment packages.
Note
This article does not discuss using solution packages to deliver your custom SharePoint Foundation 2010 development work to the front-end Web servers or the application servers in your server farm. By using solution packages, you can deploy artifacts in a disconnected environment, and you can deploy artifacts and developed site elements in the same package. For more information, see Deploy solution packages (SharePoint Foundation 2010).
When to use a content deployment package
You can use content deployment packages to deploy authored site elements in one or more of the following scenarios:
One-time content migration Use a content deployment package to move content to a destination site collection only once. If you plan to update content regularly on a destination site collection, use the content deployment feature or the Content Migration API.
Disconnected environments If the farms are disconnected, you can create a content deployment package for asynchronous transfer to the integration farm.
Sample content If authored site element customizations need to be deployed from the authoring environment to the integration environment to be used as samples for development purposes, you can use a content deployment package to simplify this process.
Before you begin
To eliminate potential synchronization issues, you must often deploy developed site elements before you deploy authored site elements. Farm solutions and Web application solutions must be installed and deployed to the destination farm prior to content deployment. Also be aware that you must install on the destination server any language packs that are in use on the source server; if you fail to install the required language packs, content deployment will fail.
Before performing the procedures in this article, familiarize yourself with the concepts related to the deployment of site element customizations. For more information about planning and designing sites and site collections, see.Fundamental site planning (SharePoint Foundation 2010). Also, download an Excel version of the Content deployment planning worksheet (https://go.microsoft.com/fwlink/p/?LinkID=167835).
Deploy content by using the Content Migration API
Most deployment scenarios can be accomplished by using Central Administration without the need for scripts. However, you can use the object model to handle other scenarios, such as writing scripts to automate common tasks and setting custom properties for export and import that you cannot configure you set up a deployment by using the SharePoint Central Administration site. You can also create code that exports and imports a content package in situations where connectivity between a source farm and a destination farm may be limited or unavailable.
For more information about content migration and the content migration APIs, see Content Migration Overview (https://go.microsoft.com/fwlink/p/?LinkId=187033). For an overview of the content deployment feature and the background and resources necessary to build and implement custom deployment solutions, see Deploying Content Between Servers (https://go.microsoft.com/fwlink/p/?LinkID=181466). For a code example that shows how to use the object model to create paths and jobs that deploy content between site collections, see How to: Deploy Content Between Servers (https://go.microsoft.com/fwlink/p/?LinkId=187034). For a code sample and information about how to export and import a content package by using the Content Migration API, see How to: Customize Deployment for Disconnected Scenarios (https://go.microsoft.com/fwlink/p/?LinkID=181076).
Create a content deployment package by using Windows PowerShell
You can use Windows PowerShell to create a content deployment package that contains the authored site elements for a whole site (including all the content in the site) or a list or a document library.
Note
Use content deployment packages for a one-time migration of content to a destination site collection. Use the content deployment feature or the Content Migration API to periodically move content from a source site collection to a destination site collection.
Content deployment packages are implemented as CMP (Content Migration Package) files. You export this package from the source server, and then import it into the destination server. You can use this method of content deployment in both connected and disconnected environments.
If you are using a software configuration management system, follow the steps for exporting the content deployment package, and then use the procedure appropriate to your software configuration management system to save the exported file.
To create a content deployment package by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt, type the following command:
Export-SPWeb -Identity <URLname> -path <ExportFileName> -IncludeUserSecurity -IncludeVersions 4 -NoFileCompression
Where:
<URLname> is the site to export. This site is written to the content deployment package together with all the subsites beneath it.
IncludeUserSecurity causes the new site to have the same permissions as the original site.
IncludeVersions is set to 4 to specify that all versions should be included.
NoFileCompression causes the content deployment package to be output to an uncompressed folder instead of a single CAB file. This makes it more complicated to deploy the deployment package to a different server, but makes it easier to edit the individual files.
For more information, see Export-SPWeb.
Note
We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.
To import a content deployment package by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt, type the following command:
Import-SPWeb -Identity <URLname> -path <ImportFileName> -IncludeUserSecurity
Where:
- <URLname> is the site that will be imported, together with all the subsites beneath it.
For more information, see Import-SPWeb.
Note
We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.