Friday, 2 February 2007

SharePoint 2007: Content Deployment - Moving your content from Server to Server

The last cool feature that seems (up to now) to work like a charm in 2007 is Content Deployment. Basically, you can use content deployment to migrate your build from development to production. If you search for content deployment, I'm sure you'll find the nice MSDN blog which states how wonderful the content deployment is ... well, it is!

Ton Stegemen has a good blog about this:
Even though Ton has code to do all the steps, you can do all of it without any code, through the Central Administration only.

The steps are:

  1. In the Destination Server go to Central Administration > Operations > Content Deployment > Content Deployment Settings, and set the server to Accept Incoming Content Deployment Jobs.

  2. There are other settings which you can do in this page like Encryption, or which server in a farm you will use for Import / Export. For my testing I didn't need any of them.

  3. Content deployment allows you to choose which Web Application / Site Collection to deploy to, therefore you need to make sure that the destination infrastructure has been setup correctly.

  4. The Site Collection you want to migrate to must be an empty Site Collection, i.e. it is very important to create a site collection based on a Blank Site template. If you don't have a blank site, you will get various errors. Most of them will be due to the fact that a number of Objects would have been already created. E.g. if you've created an (empty) Collaboration portal (assuming that all content will be copied to it), the content deployment will fail (because it will try to overwrite already existing objects and fail). Therefore, start with a clean slate (i.e. a Blank Site template).

  5. On the Source Server you need to create a Content Deployment Path from Central Administration > Operations > Content Deployment > Content Deployment Paths and Jobs. Create a new path, choose the Source Web Application / Site Collection, then specify the url of the Central Administration on the destination server. Don't put the Site Collection url, because Content Deployment works from Central Administration of the Source to the Central Administration of the server.

  6. Define the Authentication method that the Source Central Administration will be using to run on the Destination Central Administration. This means that the account you provide must have Central Administration rights on the destination server. This is another critical step. My test setup was between a normal network, therefore I used a Integrated Windows authentication account and used an account which existed on the destination server. Once you provide the correct credentials, the Central Administration will connect to the destination, and allow you to select the Web Application / Site Collection to deploy to.

  1. As soon as the Path is created, a Quick Deploy Job is automatically created. However, this is not the Job that you should use to Deploy all your content. This should be used for any updates, after you have migrated all the content already.

  2. Create a new Job (Migrate All) from the Path you have defined. Click the Path, and Create Job. Select the Path which you have created on the previous steps. Define whether you want to copy the entire site collection, or only a subset, and define a schedule (or run once). Run once allows you to run the Job ad hoc. Choose deploy only new, changed or deleted content, and specify email to send confirmation of finished job

  3. Therefore you should now have:
  • Destination Server which accepts Incoming Content Deployment Jobs connections.
  • Web application with a blank site Site Collection created on it.
  • Content Deployment Path with correct authentication from Source Server to Destination Server.
  • Job (Migrate All) which will be used to Migrate all the content.

  1. Click on the Migrate All Job, and Click Run now. Wait until all the content is copied!
  2. Once all the Content has been deployed if you update the source, you can re-run the jon to migrate new content to the destination.

Issues I have encounterd:

  • If you try to migrate the content using the Quick Deploy, it will succeed, however nothing will be actually copied. When I tried to re-run, I an unknown error was thrown. Once this error was thrown, I had to delete the Web Application at the destination and re-create it from scratch, and also create the Path and Job all over again! Bug maybe?

  • If you have enabled Self-Service Site Management, you need to ensure that any additional Site Directories have already been created on the destination Web Application. The content deployment will not create the Site Directories. For each Site directory you have, you must create a Site Directory based on the Blank Site template on the destination. Besides this you must create a new Path to each Site directory and a job which will copy the contents of the Source Site Directories.
Questions raised by the migration and which require testing: What happens when you migrate a build to a client, the client starts doing their changes, and then you need to update with another version of the build?

Still need to investigate this and probably other issues, however, the first encounter seems quite nice.