Mastering Sitecore Content Serialization Scopes
Sitecore Content Serialization Scopes Include Strategies: Navigating ItemAndChildren, ItemAndDescendants, and the Power of Ignored
Zoe Ferguson
Front End Developer
Front End Developer
Sitecore Content Serialization Scopes Include Strategies: Navigating ItemAndChildren, ItemAndDescendants, and the Power of Ignored
Front End Developer
Front End Developer
Choosing the wrong scope is a common way that developers accidentally break a production environment or bloat their Git repository. Sitecore Content Serialization (SCS) isn't "all or nothing", you have options when it comes to choosing what gets serialized. We'll dive into the difference between ItemAndChildren and ItemAndDescendants (the default value) and discuss which option is best for your specific needs and when to use Ignored. It's important to understand all of the options to avoid deployment accidents which can lead to overwriting content or performance bottlenecks.
ItemAndChildren serializes the parent item and it's immediate children only. You would choose this option when you only care about the top-level structure, as it avoids serializing deeply nested unnecessary items. It helps to keep serialization files organized and relevant while excluding unnecessary content. Performance Impact: High efficiency; it limits the crawler's depth.
The Risk: Forgetting that "grandchildren" are completely ignored.
ItemAndDescendants is the default and most comprehensive scoping option. It is used to capture the root item as well as it's entire tree structure (children and grandchildren included). You'll want to choose this option when you're looking to serialize, version control and deploy an entire subtree of items. It ensures the structure remains intact across environments. Performance Impact: Can be heavy. On large content trees, this can significantly slow down ser pull and ser push operations.
The Risk: The "Content Overwrite" nightmare. If used on a content node, a developer might accidentally revert a content author's work to an old version stored in Git.
Ignored is used to exclude specific items or entire sub-trees from the serialization process. There are a number of instances when Ignored would be useful:
ItemAndDescendants include rule. This will ensure that a specific branch is skipped| Scope strategy | Depth | Performance | Best for... |
|---|---|---|---|
ItemAndChildren | Single level | Fast | Folders, settings, roots |
ItemAndDescendants | Recursive (full) | Slower | Templates, branch templates, layouts |
Ignored | None | Instant | Protecting content, media, test data |
Scopes are about precision. Use the information above to consider your content tree and project context. You can always run ser pull --whatif before committing your module changes to preview the impact without modifying any data.
Start typing to search...