<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">Sorry to hear about this... it sounds like your diagnosis is correct that this is a helpful feature gone awry. The default for macOS Server's Calendar service is for this feature to be enabled, and to delete data associated with users that have been missing from the directory for more than one week. Most of the configurable values are not expressed in the main config file, but rather inherited. Here's a full view of the available knobs:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/apple/ccs-calendarserver/blob/master/conf/caldavd-stdconfig.plist#L2114" class="">https://github.com/apple/ccs-calendarserver/blob/master/conf/caldavd-stdconfig.plist#L2114</a></div><div class=""><br class=""></div><div class="">First thing you should do is check the calendarserver_trash tool, a command line tool that might be able to recover data for you. I honestly don't remember if data purged by 'AutomaticPurging' can be recovered by calendarserver_trash, but it's definitely worth a shot. Run it with "-h" to see the options.</div><div class=""><br class=""></div><div class="">If you have to restore from backup, it goes something like this:</div><div class=""><br class=""></div><div class="">1) Fish the DB directory out of your backups. By default, it's at "/Library/Server/Calendar and Contacts/Data/Database.xpg" (I think. See below.)</div><div class="">2) Stop the service</div><div class="">3) Move the existing Database.xpg aside (don't delete it, just move or rename it)</div><div class="">4) Copy the Database.xpg directory from your backups into place</div><div class="">5) Start service</div><div class=""><br class=""></div><div class="">Caveat: it has been literally years since I touched any of this, but I can say that the database wrapper used by CalendarServer was designed to make this sort of stuff as easy as possible (or at least, far far easier than the equivalent cajoling of Postgres required to do it 'the old fashioned way'.)</div><div class=""><br class=""></div><div class="">You might choose instead to restore the entire "<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">/Library/Server/Calendar and Contacts/Data/</span>" directory, which by default includes Database.xpg and also event attachments.</div><div class=""><br class=""></div><div class="">To fully comprehend how CalendarServer evaluates relative paths for things in config files, you also need:</div><div class=""><a href="https://github.com/apple/ccs-calendarserver/blob/master/twistedcaldav/stdconfig.py#L1276" class="">https://github.com/apple/ccs-calendarserver/blob/master/twistedcaldav/stdconfig.py#L1276</a></div><div class=""><br class=""></div><div class="">Because the <a href="https://github.com/apple/ccs-calendarserver/blob/master/conf/caldavd-apple.plist" class="">macOS server plist</a> configures an absolute ServerRoot and relative values for DataRoot and DatabaseRoot, that should mean that Database.xpg lives inside "<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">/Library/Server/Calendar and Contacts/Data/".</span></div><div class=""><br class=""></div><div class="">Good luck!</div><div class=""><br class=""></div><div class="">-dre</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 6, 2020, at 9:24 AM, Sean McBride <<a href="mailto:sean@rogue-research.com" class="">sean@rogue-research.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi all,<br class=""><br class="">I'm running CalendarServer on macOS 10.13.6 with Server.app 5.6.3 and it's been basically set-and-forget. But now I have a big problem.<br class=""><br class="">I updated a network switch's firmware, which broke the connection from my Calendar server to my (separate) Open Directory server. For whatever reason, the connection didn't auto-reestablish. This went unnoticed for days during the holidays.<br class=""><br class="">Back in the office today, no one could authenticate. Magic reboot didn't help. I had to go to Sys Prefs > Users&Groups > Login Options and un-join and re-join to the OD server. Now I can authenticate to the calendar server, but everything seems to be gone! Looking in the logs, I see things like:<br class=""><br class="">2019-12-27T18:48:28-0500 [caldav-2] [calendarserver.tools.purge#warn] Principal XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX is no longer in the directory; scheduling clean-up at 2020-01-03 23:48:28.984229<br class=""><br class="">2020-01-03T18:48:29-0500 [caldav-1] [calendarserver.tools.purge#warn] Cleaning up future events for principal XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX since they are no longer in directory<br class=""><br class="">So has it indeed "helpfully" deleted everything for me? :(<br class=""><br class="">I do have backups. Is there a single database file I could restore? Where is it?<br class=""><br class="">Thanks for any help!!!<br class=""><br class="">Sean<br class=""><br class=""><br class="">_______________________________________________<br class="">calendarserver-users mailing list<br class=""><a href="mailto:calendarserver-users@lists.macosforge.org" class="">calendarserver-users@lists.macosforge.org</a><br class="">https://lists.macosforge.org/mailman/listinfo/calendarserver-users<br class=""></div></div></blockquote></div><br class=""></div></body></html>