Back in May I wrote a post titled SharePoint deployment options : Features or Content Deployment?, which discussed some thoughts on what was the "right" way to move assets from development to production (and perhaps environments in between) during the site development process in SharePoint. Having now worked on other projects and consciously used different deployment methods on each, I'm rapidly coming to the conclusion that the "right" way to do deployment varies according to circumstances. So I thought what might be useful is an analysis of the whole range of deployment options, with information which might help you decide more easily on how you will complete this crucial step of the process.
So let's run through the options and their characteristics. Note by the way, that none of the options use 'destructive synchronization', where all content is first deleted before import.
Using STSADM export/import
Description:
Uses STSADM commands to generate a file (export) which can then be transferred to the target for import. One of the simplest ways of moving content from one place to another, although unlikely to be suitable as a continuous deployment mechanism. Examples:
stsadm.exe -o export -url http://localhost -filename C:\Export.cab -includeusersecurity -versions 4 -overwrite
stsadm.exe -o import -url http://localhost/sites/newsite -filename C:\Export.cab -includeusersecurity
Good for:
- Moving an entire site/web as a one off
- Quick deployment tests
- Reparenting webs (can be into a different site collection)
Considerations:
- Content on target will be overwritten if already exists
- Granularity down to web only
- Object GUIDs are not preserved (so some things will need to be 'fixed up' e.g. anything that references a list by GUID - ListViewWebPart, using lists with InfoPath forms)
- Not a backup/restore tool - although it's the option which is most like backup/restore, things like alerts, audit trail, recycle bin items, security state, workflow tasks/state are not exported
- Not transactional
Using Content Deployment via Central Admin *
Description:
Configured via 'Content Deployment paths and jobs' in Central Admin ('/_admin/deployment.aspx'). A path defines the source/target and authentication details, specific jobs define exactly which content should be deployed and how often. Quick deploy functionality allows users with permissions to specify important content which should be deployed more regularly than existing job schedules configured by administrators (quick deploy items are deployed every 15 mins).
Good for:
- Moving entire site collections/webs on a scheduled basis e.g. in an authoring/production or authoring/staging/production topology
- Deploying only incremental changes, e-mail notifications of success/failures
- Allowing site owners to have some control over content deployment via Quick Deploy
- Automatically deploying dependencies of content selected for deployment, even if in different site (e.g. page layouts/content types/site columns/referenced images etc.)
- Automatically transferring the deployment package to the target environment (via HTTP[S])
- Not transactional
Considerations:
- Content on target will be overwritten if already exists
- Granularity down to web only
- No differentiation between site content (e.g. pages/images) and site 'infrastructure' (e.g. master pages, page layouts)
- Object GUIDs are preserved
- Blank site template should be used for
source anddestination site collection (see http://support.microsoft.com/kb/923592) - Also not a backup/restore tool (see above)
Using the content migration API *
Involves writing code which uses the content migration API (known as PRIME) to export then import content - the API is easy to use.
Good for:
- Complete flexibility over deployment options
- Granular control over what gets deployed (down to item level)
- Ability to preserve object GUIDs (so that list GUIDs do not need to fixed-up)
- Ability to select options for security, versioning and user roles
Considerations:
- Blank site template should be used for
source anddestination site collection (see http://support.microsoft.com/kb/923592) - Not transactional
- Also not a backup/restore tool (see above)
- Need development skills to write code
Using Features/Solutions
The focus of this blog for several articles. Involves defining XML configuration files which SharePoint uses to add artifacts in the correct way on the target. This can be significantly more complex than simply developing in SharePoint Designer but can allow for better management throughout a solution's lifecycle.
Good for:
- Iterative development/deployment
- Deployment of assemblies and filesystem files (none of the other methods deal with this)
- Ability to deploy assemblies/filesystem files to all servers in a farm with Solution packages
- Possibilities for continuous integration
Considerations:
- Developer is responsible for evaluating and deploying dependencies (e.g. underlying content types).
- Updates to content types, list definitions, site columns etc. deployed via a Feature must be done with the API - modifying original Feature files and then reprovisioning is not supported
- Can be very time-consuming due to lack of assistance from current tools
* Some additional notes on using Content Deployment or content migration APIs: - appropriate Features will automatically be activated on the target, but they must be present (i.e. installed) for content deployment to work (N.B. publishing feature should not be enabled on target for first deployment) - using Content Deployment or content migration API with RetainObjectIdentity option should not be combined with STSADM -export/import, since the latter will allocate new IDs! |
So clearly there can be a few aspects to consider in choosing how to go about deployment for your project. In many scenarios where Features/Solutions aren't the most appropriate option, I favor using the content migration API, mainly due to the flexibility which isn't provided in any of the other options. Of course it does mean writing code, but as I mentioned last time, I'll soon share the mini-app I wrote so you don't have to!
Some useful references: