Serialization woes with Sitecore and Windows

Posted 02/23/2015 by Akshay Sura

This comes as no surprise when I say that Serialization for Sitecore has its limits and conditions. When you try to serialize a huge tree with muli-level folders you often run into issues.

First, there are not the limitations of Sitecore and products like Unicorn and TDS. This is a base Windows limitation where some of the Windows API, including the Windows explorer are limited by the MAX_PATH which is 260 characters.

In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string<NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)

There are workarounds to get around this in the explorer but how do we get around it from a Sitecore perspective. Glad you asked. Instead of performing the serialization the way it is, which is to create an item file and a folder for each parent node, we need to create top level, Sitecore system folders into which we can dump the serialization files.

I am not asking to change the actual Sitecore item to file serialization functionality but just the way we store it in the file system.

serialize

serialize folders


References:

Naming Files, Paths, and Namespaces - MSDN

WINDOWS FILE PATHS LONGER THAN 255 CHARACTERS - Code 42

Share:

Archive

Syndication