SharePoint 2007 Service Pack 1 and Content Deployment

Monday, 28 April 2008 13:32 by RanjanBanerji

I just installed SharePoint 2007 SP 1 and immediately after encountered the following error: Violation of PRIMARY KEY constraint 'PK__#ExportObjects____4FA910ED'. Cannot insert duplicate key in object 'dbo.#ExportObjects'.

It turns out that this happens in some cases.  I have no way to confirm that.  I know it happened to me.  The good news is that if, like me, you are a late comer to SP1 then applying any of the post SP1 roll ups will fix this problem.

I installed the following post SP patch: and was good to go.

Categories:   SharePoint
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Content Deployment - Getting it Right

Thursday, 17 April 2008 19:55 by RanjanBanerji

So I have all these posts about problems with content deployment.  What is one to do to get it right.  Well, we just might be lucky.  Stefan Gossner has written a great series on content deployment and the 6th part of this series focuses on what do to do get it right.  Clearly this is a great place to start.  However, there are a few additional pointers.  I strongly suggest that you read all 6 parts of his posts named "Deep Dive into the SharePoint Content Deployment and Migration API".

But in addition to that I suggest you also pay attention to:

  • Be careful about the frequency of deployment jobs.  Content deployment has a severe impact of performance if your site heavily uses cross list queries, CQWP, or the object cache.  Deployment wipes clean the object cache.  For more details read this post.
  • Be careful about how many jobs you run not just their frequency.  Sometimes its necessary break down deployment into smaller jobs to get initial deployment as I talk about here and here.  But if you have too many content deployment jobs running you can adversely impact the performance of your application as content deployment will wipe clean your object cache after each job has run.
  • Write a script to change the default timeout for transport/import to a larger number.  Default is 10 minutes and how this timeout works is a little weird.  I thought it was the time taken to transport and import each item.  But I was corrected by Tim Clark (a colleague).  The timeout is for the time taken between the last object as been transported to the destination and the import process.  So if you have a large deployment (greater 20GB or s0) it may take more than 10 minutes to decompress the files and the timeout will kick in and kill your deployment job.

Create a console application with the following code and you should be good to go.   You may not want to hardwire to the new timeout.  Also you may want to run the line of code I have commented out to figure out whether the input is in milliseconds or seconds.  Off hand I do not recall.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint.Publishing;

namespace Timeout {
    class Program {
        static void Main( string[] args ) {
            //Run this line first
            //Console.WriteLine( Microsoft.SharePoint.Publishing.Administration.ContentDeploymentConfiguration.GetInstance().RemoteTimeout.ToString() );
            //Then run this 
            Microsoft.SharePoint.Publishing.Administration.ContentDeploymentConfiguration.GetInstance().RemoteTimeout = 10000;
            Microsoft.SharePoint.Publishing.Administration.ContentDeploymentConfiguration.GetInstance().Update( true );


  • Be careful about full deployments.  Your database size will grow with each full deployment.  With each full deployment of content you will get an extra version at the destination.  So it is possible to have a destination database that is larger than your source.  Be careful.
  • Evaluate whether you want versions turned off at the destination.  If so write a script to turn it off.  However, once turned off a Full deployment will turn it on and grow the database again.  So be careful.
  • Lookout for the following error: "The underlying connection was closed: An unexpected error occurred on a receive".  It is rare but it happens and it took us a long time to figure out just what was going on.
  • Train your users not to delete objects (documents, lists, sites, pages, etc) and recover from the recycle bin.  Say What?  What kind of crazy talk is that? Well what can I say.  If you delete an object then recover it from the recycle bin (recycle bin is a new feature introduced in SharePoint 2007) you will kill content deployment.  Once you recover from the recycle Content Deployment will keep failing until you delete the object from the destination application.  But what object?  Content Deployment error messages do not tell me which one caused the problem.  Read this:  Microsoft has a private fix for this.  That means if you have a support ticket with them you can get access to the fix and apply at your own risk since it has not yet been tested by Microsoft itself.  Good luck with that.  My personal recommendation is that unless there is a fix disable the recycle bin feature.  How?  I am researching that.


I will update this page as I recall more issues.

Categories:   SharePoint
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed