Mac OS X 10.6 Server Admin: Understanding the Data Store and File Hierarchy for iCal Server

This article has been archived and is no longer updated by Apple.

By default, the main data store location is /Library/CalendarServer/Documents/, but you can specify another location using the Settings tab of the iCal Server administration pane in Server Admin.

The CalendarServer folder is owned by root/admin. The Documents folder and all folders nested in it are owned by _calendar/_calendar.

The permissions on the hierarchy are set to 750 (user can read, write, and execute; group can read and execute; there are no permissions outside of the group), so you can’t browse the files without root access.

iCal data files are flat files. They don’t require special tools to inspect them. All file properties (including the ACLs) are kept in XML format in the files as extended attributes (xattrs). Any backup or file manipulation tool you use to move or edit the files must support and preserve extended attributes.

In Mac OS X Server v10.6, the following command-line tools preserve extended attributes:  cp, scp, ditto, tar, pax, rsync (with the -E flag).

In addition to using data files, the calendar server makes extensive use of sqlite databases indexes for performance. It uses sqlite to index Globally Unique Identifiers (GUIDs) and time spans for events. The sqlite databases are disposable and are rebuilt as needed.

Calendar principals (users, groups, resources, and locations) are defined by a GUID. A GUID is a 128-bit value hexadecimal notation that uniquely identifies the principal.

This is the organization of the data store:

Location
Description

./calendars/__uids__/<WX>/<YZ>/<GUID>

Contains files for each user or group that has created at least one event, todo, or calendar.

W and X are the first 2 digits of the GUID. Y and Z are the 3rd and 4th digits. GUID is the entire GUID, including the first 4 digits.

./calendars/__uids__/<WX>/<YZ>/<GUID>/calendar/

Contains iCalendar (.ics) files of each event in the principal's calendar.

W and X are the first 2 digits of the GUID. Y and Z are the 3rd and 4th digits. GUID is the entire GUID, including the first 4 digits.

./calendars/__uids__/<WX>/<YZ>/<GUID>/inbox

Contains iTIP file invitations to other user's pending events.

W and X are the first 2 digits of the GUID. Y and Z are the 3rd and 4th digits. GUID is the entire GUID, including the first 4 digits.

./calendars/__uids__/<WX>/<YZ>/<GUID>/outbox

Nothing is stored in the outbox, but it is used as the target for certain types of scheduling operations.

W and X are the first 2 digits of the GUID. Y and Z are the 3rd and 4th digits. GUID is the entire GUID, including the first 4 digits.

./calendars/__uids__/<WX>/<YZ>/<GUID>/dropbox

Contains files attached to events, either from a user's self-created event or from participant events.

W and X are the first 2 digits of the GUID. Y and Z are the 3rd and 4th digits. GUID is the entire GUID, including the first 4 digits.

Note:  Mac OS X Server v10.5 iCal Server's file structure is different. If you upgrade from the old version to Mac OS X Server v10.6, the old file structure is upgraded to the new structure on an as-needed basis as users access their calendars. Anyone upgrading from Mac OS X Server v10.5 to Mac OS X Server v10.6 may see both directory layouts coexisting, although at any one time there is only one path for a GUID.
Published Date: Aug 6, 2013
Helpful?