MOSS Content Deployment Jobs – Lookup Fields and requirements

Content Deployment Job is a nice feature of MOSS 2007 to secure your main site from unauthorized and accidental changes and have approved content being deployed via standard MOSS functionality.

But Content Deployment Jobs are a bit tricky 🙁

There are some areas which I”d like to highlight in the current post, which helps you to save hours in configuring Content Deployments Path and Jobs

 

Requirements

To have successful contend deployment you need to prepare your sites correctly. There is a great post from Stefan Gossner who provided detailed explanations to all pre-requirement.

Just to summarize, you need:

  • Destination Site without any template pages (don”t use “Blank” template even)
  • Deploy features to Source and Destination sites
  • Activate features ONLY on Destination site

 

Incremental Deployment

When you set deployment path and created your first job you need to do full deployment (“Deploy all content” option) first, and after it”s done set the incremental deployment.

Your incremental job could fail with the next exception

Violation of PRIMARY KEY constraint ”PK__#ExportObjects____50430BFC”. Cannot insert duplicate key in object ”dbo.#ExportObjects”.”

The reason is that SP1 for MOSS changed the document versioning system, but no changes where done to Content Deployment Job functionality. To solve this issue  you may need to install the following hotfix http://support.microsoft.com/kb/950279 or disable minor versioning for specific lists (google to find details about this)

 

Lookup fields

The biggest trick in Content Deployment Jobs relates to Lookup fields deployed via Feature. I think that the following exception will be familiar for those who tried run Content Deployment Jobs for Site with Lookup Fields feature

The element ”FieldTemplate” in namespace ”urn:deployment-manifest-schema” has invalid child element ”Field” in namespace ”http://schemas.microsoft.com/sharepoint/”. List of possible elements expected: ”Field” in namespace ”urn:deployment-manifest-schema”. at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(ValidationEventHandler eventHandler, Object sender, XmlSchemaValidationException e, XmlSeverityType severity) at System.Xml.Schema.XmlSchemaValidator.ElementValidationError(XmlQualifiedName name, ValidationState context, ValidationEventHandler eventHandler, Object sender, String sourceUri,Int32 lineNo,Int32 linePos, Boolean getParticles) at System.Xml.Schema.XmlSchemaValidator.ValidateElementContext(XmlQualifiedName elementName, Boolean& invalidElementInContext) at System.Xml.Schema.XmlSchemaValidator.ValidateElement(String localName, String namespaceUri, XmlSchemaInfo schemaInfo, String xsiType, String xsiNil, String xsiSchemaLocation, String xsiNoNamespaceSchemaLocation) at System.Xml.XsdValidatingReader.ProcessElementEvent() at System.Xml.XsdValidatingReader.ProcessReaderEvent() at System.Xml.XsdValidatingReader.Read() at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject) at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope) at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream) at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream) at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader) at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects() at Microsoft.SharePoint.Deployment.SPImport.Run() 

5/22/2008 11:14 AM Content deployment job ”Remote import job for job with sourceID = 0ffd575d-df2f-474f-83b6-f3454f2e7d0d” failed.The exception thrown was ”System.Xml.Schema.XmlSchemaValidationException” : ”The element ”FieldTemplate” in namespace ”urn:deployment-manifest-schema” has invalid child element ”Field” in namespace ”http://schemas.microsoft.com/sharepoint/”. List of possible elements expected: ”Field” in namespace ”urn:deployment-manifest-schema”.”

The problems is exactly in deployment scripts of Lookup fields. There are several samples how to deploy lookup fields via feature (http://www.sharepointnutsandbolts.com/2007/04/feature-to-create-lookup-fields-on.html) but all of them are not suitable for the Content Deployment Jobs. Because you will get the exception which I posted above.

The only way to find out why this happens is to use 3rd party tools (SharepointSpy or FieldsExplorer) to compare the SchemaXML of Lookup Fields after deployment via FeatureReceiver. So, after scrutinizing this issue I found out that deploying Lookup Fields via FeatureReceiver differs from Lookup fields create via Central Admin Web site. FeatureReceiver deployment adds additional attribute “xmlns=”http://schemas.microsoft.com/sharepoint/” to the Lookup SchemaXML which breaks the Content Deployment Job.

So, the solution is simple – verify the published schema in FeatureReceiver before calling Update() method for Lookup Field and remove this attribute.

 

Mirror: MOSS Content Deployment Jobs – Lookup Fields and requirements

9 Comments »

  1. Chad Said,

    February 9, 2009@ 5:02 pm      Reply

    So when you say that the solution is simple 🙂 I”m at my wits end with this error and still cannot get it resolved. Any additional insight would be greatly appreciated. Thanks.

  2. Sree Said,

    February 10, 2009@ 11:17 pm      Reply

    Hi Michael

    We are having a strage issue for content deployment.

    We deploy content from Authoring to QA and from QA to production.

    Recently we noticed that when we deploy content from QA to production it is loosing navigaion. Means when I go to “_layouts/AreaNavigationSettings.aspx” it is not showing the navigation URL basically the last two boxes on this page are empty.

    What do you think could be reason? Has anyone encountered this kind of issue?

  3. laflour Said,

    February 10, 2009@ 11:22 pm      Reply

    Sree, check the ULS logs for “AreaNavigationSettings.aspx” file records in ContentDeployment category, if it was copied to destination server.
    What could happens is that you already have this file there, or it is checked out there

  4. antverpen Said,

    November 29, 2009@ 11:38 pm      Reply

    Dear Author msmvps.com !
    Earlier I thought differently, I thank for the help in this question.

  5. cosmopolit70 Said,

    December 25, 2009@ 8:54 am      Reply

    I want to quote your post in my blog. It can?
    And you et an account on Twitter?

  6. laflour Said,

    December 25, 2009@ 11:44 am      Reply

    Just quote what you want but keep the reference on this site.

    I”m laflour in twitter, you can find the twitter icon on the left of this site that redirects you on my account

  7. kewa Said,

    March 18, 2010@ 10:21 am      Reply

    Hi Michael,

    Nice article, I wasted some hours on lookup fields before finding your article.

    I”m experiencing an other issue on content deployment.
    I have a feature that modify the “web.config” file to enable .NET framework 3.5 and add my assemblies to safe controls.
    But a full deployment give me this error :
    “The webpart component myassembly.dll v2.0.50727 is missing in the safe controls” (translated from french)

    Have you heard of something like this ?

  8. laflour Said,

    March 18, 2010@ 9:41 pm      Reply

    Your feature DLL (that one that performs the web.config modificaion) seems has not been added to the web.config as the SafeControl during the feature deployment

  9. kewa Said,

    March 19, 2010@ 10:41 am      Reply

    Usually the SafeControls are added when the solution is deployed. So, in a content deployment situation, it should happen on source and target farm.

    You mustn”t activate feature on target site if their activation will modify database content.
    But if some features apply other modifications, in particular on system files (web.config, resources files, browser files…), you must activate them before content deployment.


RSS feed for comments on this post · TrackBack URI

Leave a Comment