SDL Content Porter’s Synchronization Option

An SDL Tridion schema is the (.xsd) definition for content. Eventually you may need to re-order, add, or remove fields to accommodate changes to your content model. Changing a schema doesn’t instantly change content based on this schema (trust me, you probably wouldn’t want it to). To make such an update, authors can open and close items in the Content Manager Explorer which will synchronize components to their updated definitions.

This works for a few dozen items, but can quickly get monotonous for several hundred components. Per SDL Live Content (http://sdllivecontent.sdl.com/), SDL Content Porter 2009 and later have the ability to “Synchronize Components against Schema before importing.”

“If you import a Component or a content item that has metadata, without also importing the (Metadata) Schema on which the item depends, the item you import may not match the Schema on the target system. Selecting this option tells Content Porter to attempt to modify the import item to match the Schema found on the target system.”

There’s a very important note that “selecting this option could lead to data loss.”

This synchronization option covers field re-ordering, removing fields no longer in the target schema(s), and adding new fields as long as they’re optional and/or have a default value. Also important is realizing this is a synchronization action which makes some existing fields match an updated schema. It should be clear that things like renaming fields and requiring a field without a default would require more manual (or programmatic) work.

The option is selected by default on an import, all you have to do is update the target schema before doing the import. Again, be careful with this as schema changes can lead to data loss.

Choose "Synchronize content against Schema before importing"

“Synchronize content against Schema before importing” is selected for you during imports



Steps:

  1. Content Port the components you would like to synchronize. This should also work with items with metadata schemas (I’ve used this for at least components so far).
  2. Change the schema in the CME by either moving/removing fields or adding optional fields/mandatory fields with a default.
  3. Import the components. Content Porter will move fields accordingly, remove non-matching fields, and add new fields filling in any defaults.

    The Content Porter log should show the synchronization results, for example I moved a field as seen in this log snippet.

    8/30/2013 5:26:08 PM [Information] Content synchronization started
    8/30/2013 5:26:08 PM [Information] Content of item “/webdav/200 Global Content (English)/Building Blocks/Content/050 Events/2012 Sound Xperience hits the road.xml” has been successfully synchronized according to Schema “/webdav/200 Global Content (English)/Building Blocks/System/Schemas/Editorial Schemas/Event.xsd”.

    Tip: look at the source, optionally in Internet Explorer on the server, rather than preview to see the difference. Preview may show you some schema changes even if the source content hasn’t been syncrhonized yet.

    To get back to a previous state, roll back your schema changes and re-import matching content. It’s always a good idea to test your scenario in a test or “throwaway” (i.e. cloud) environment.

    For other ways to synchronize, see this Tridion Stack Exchange question and answer. The SDL Tridion Power Tools has some work towards resurrecting a GUI Extension as well as a branch with a PowerShell example, compliments of Dominic Cronin. But with the number of Core Service examples online, I suspect SDL Tridion-using developers are doing quite fine creating, change, and adjusting components using their favorite IDE or shell scripting approach (Visual Studio, LINQpad, or PowerShell to name a few popular approaches).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>