My last entry about serializing items and whole databases was kind of more an introduction. Today I’m going to explain in detail what the ribbon buttons do. I’ll finish this series tomorrow by showing how to do this from code.
Serialize Item: This option let’s you serialize the currently selected item to disk. This means that when you serialize for example /sitecore/content/home, the following stuff will be created in %root%/data/serialization:
- Let’s assume that the item located is in the master database, then the action will create a folder ‘master’.
- The action creates creates the folder: /sitecore and /sitecore/content
- Finaly the item creates a home.item-file which contains the contents of the item
Serialize Tree: This option is similar for the first 2 steps comparing it to serialize item. In the third step the action now creates a hierarchy of items and folders from the current item.
Let’s assume that the home item has 2 child items, e.g. child1 and child2. The system will create the following folders and items:
- /master/sitecore/content/home.item (item-file)
- /master/sitecore/content/home/ (folder)
- /master/sitecore/content/home/child1.item (item-file)
- /master/sitecore/content/home/child2.item (item-file)
Update Item: This option loads an item from disk without forcing to overwrite. So if a field in empty(null) or a versions doesn’t exists, the Update Item will add this data, but never overwrite.
Revert Item: This options load an item from disk but forces to overwrite. So when fields have changed, they will get processed and overwritten. You can imagine this might be a bit more time intensive then the previous one.
Update Tree: Same as update item, but now for a whole tree.
Revert Tree: Same as revert item, but now for a whole tree.
Update Database: Same as revert item, but now for a whole database.
Revert Database: Same as revert item, but now for a whole database.
There’s also a hidden command, which is of course unsupported ;). It’s called ‘LoadAllDatabases’. To enable this, go to you core database and navigate to: /sitecore/content/applications/Content Editor/Ribbons/Chunks/Serialize. Then duplicate ‘Update Database’ and ‘Revert Database’. Change the names to ‘Update all Databases’ and ‘Revert all Databases’. Use the following commands: ‘itemsync:loadalldatabases’ and ‘itemsync:loadalldatabases(revert=1)’.