The YAML serialization format

Current version: 10.2

When you use the YAML serialization format, you can use serialize as many item trees that you want. This is different from the the default format that always uses one tree per database (master, core). You specify this in the predicate node in the configuration file. The following rules and limitations apply:

  • Each item can only be in one tree.

  • An item that is not included in a tree is not stored when you serialize.

  • If you select one item for serialization, the whole content tree is serialized as well.

Users and roles are not stored in trees you configure, but you can filter the entities when they are stored in files.

This topic describes:

The YAML serialization file format

When you serialize items, Sitecore creates a separate text file for each item it processes. The files are stored under the root folder that the SerializationFolder setting specifies. When you configure Sitecore to save serialization text files in YAML format, the files look like this:

RequestResponse
---
ID: "110d559f-dea5-42ea-9c1c-8a5df7e70ef9"
Parent: "0de95ae4-41ab-4d01-9eb0-67441b7c2450"
Template: "76036f5e-cbce-46d1-af0a-4143f9b557aa"
Path: /sitecore/content/Home
DB: master
Created: 20190311T155629Z
SharedFields:
- ID: "06d5295c-ed2f-4a54-9bf2-26228d113318"
  Hint: __Icon
  Value: Network/16x16/home.png
- ID: "56776edf-261c-4abc-9fe7-70c618795239"
  Hint: __Help link
  Value: |
    <link url="http://www.google.com" linktype="external" />
- ID: "6fd695e7-7f6d-4ca5-8b49-a829e5950ae9"
  Hint: __Subitems Sorting
  Value: "{781247D2-9785-400F-8935-C818EC757967}"
- ID: "a4f985d9-98b3-4b52-aaaf-4344f6e747c6"
  Hint: __Workflow
  Value: "{A5BC37E7-ED96-4C1E-8590-A26E64DB55EA}"
- ID: "ba3f86a2-4a1c-4d78-b63d-91c2779c1b5e"
  Hint: __Sortorder
  Value: "-1"
- ID: "ca9b9f52-4fb0-4f87-a79f-24dea62cda65"
  Hint: __Default workflow
  Value: 
- ID: "dec8d2d5-e3cf-48b6-a653-8e69e2716641"
  Hint: __Security
  Value: "sitecore|{B92EB493-5BD2-4603-9296-7D9CB7464CFD}|5396||"
- ID: "f1a1fe9e-a60c-4ddb-a3a0-bb5b29fe732e"
  Hint: __Renderings
  Type: layout
  Value: |
    <r>
      <d
        id="{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}"
        l="{14030E9F-CE92-49C6-AD87-7D49B50E42EA}">
        <r
          id="{493B3A83-0FA7-4484-8FC9-4680991CF743}"
          ph=""
          ds=""
          par="" />
      </d>
      <d
        id="{46D2F427-4CE5-4E1F-BA10-EF3636F43534}"
        l="{14030E9F-CE92-49C6-AD87-7D49B50E42EA}">
        <r
          id="{493B3A83-0FA7-4484-8FC9-4680991CF743}"
          ph=""
          ds=""
          par="" />
      </d>
    </r>
Languages:
- Language: en
  Fields:
  - ID: "9541e67d-ce8c-4225-803d-33f7f29f09ef"
    Hint: __Short description
    Value: Welcome to Sitecore.
  Versions:
  - Version: 1
    Fields:
    - ID: "001dd393-96c5-490b-924a-b0f25cd9efd8"
      Hint: __Lock
      Value: <r />
    - ID: "25bed78c-4957-4165-998a-ca1b52f67497"
      Hint: __Created
      Value: 
    - ID: "3e431de1-525e-47a3-b6b0-1ccbec3a8c98"
      Hint: __Workflow state
      Value: 
    - ID: "75577384-3c97-45da-a847-81b00500e250"
      Hint: Title
      Value: Sitecore
    - ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
      Hint: __Revision
      Value: "fb39b6ea-11e0-4f2e-a3dd-6f2e8b1db2a2"
    - ID: "a60acd61-a6db-4182-8329-c957982cec74"
      Hint: Text
      Value: Welcome to Sitecore.
    - ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
      Hint: __Updated
      Value: 20070823T125217

Configure YAML serialization

The YAML serialization has a number of settings in the configuration file that are only relevant for this format. The most important ones are:

Setting

Description

fieldFormatters

The settings in this node specify how specific item field types are serialized. It is possible to add formatters.

predicate

Specifies the name, the database of the tree to serialize, and the path of the parent item of the tree to serialize.

userPredicate, rolePredicate

Specifies rules that Sitecore uses to filter users and roles when these entities are serialized.

Do you have some feedback for us?

If you have suggestions for improving this article,