Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Calendar server management

I'm knowning about the calendarserver_* commands.


I can backup and restore the entire calendar server. Can I restore calendars of one user only?

Deleting a user in Serveradmin does not delete its calendars (I tested it).

How do I delete orphaned calendars of not existent users? If I know its GUID, I can delete

the calendars and events with calendarserver_purge_principals. But what can I do, if

I don't know the old GUIDs?


Thank you.

Mac Pro, OS X Server

Posted on Apr 10, 2013 6:26 AM

Reply
2 replies

Apr 10, 2013 8:37 AM in response to petrahu

Perhaps write a script that reads your current user GUID's into an array. Then, iterate through all the events in the calendar server with calendarserver_manage_principals. As you iterate through each calendar, search for its GUID in the current user GUID list. If there is a match, keep it. If there isn't, delete with


calendarserver_purge_principals -C

May 2, 2013 1:16 AM in response to JaimeMagiera

petrahu wrote:


How do I delete orphaned calendars of not existent users?


Command to get all GUIDs having a calendar in calendar server:


/Applications/Server.app/Contents/ServerRoot/usr/bin/psql -h /Library/Server/PostgreSQL\ For\ Server\ Services/Socket/ -U _postgres caldav -c "select * from calendar_home;"


List all valid GUIDs:

calendarserver_manage_principals --list-principals {groups|users|resources|locations}


Then compare and delete calendars from non-existent GUIDs:

calendarserver_purge_principals 'non-existent GUID'

Calendar server management

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.