It is possible to remove all of the content from a Lion Calendar server using Postgres. To aid you in doing so, Apple has built out a couple of commands to make the process easier. This will nuke everything from the server and so is not something that should be lightly done. To do so, first stop the Calendar service in the Server application. Then let’s back up the database: pg_dump -U _postgres caldav -c -f /db_backups/caldav.sql Then run dropdb to remove the database itself: dropdb -U _postgres caldav Once the database is gone, run the calendar_bootstrap_database script (I prefer doing so verbosely): calendarserver_bootstrap_database -v Now you should be able…
-
-
Using ServerBackup to Backup Lion Servers
ServerBackup is a new command included in Lion Server, located in the /usr/sbin/ServerBackup directory. The ServerBackup command is used to backup the server settings for services running on a Lion Server. The command is pretty easy and straight forward to use, but does require you to be using Time Machine in order to actually run. In the most basic form, ServerBackup is invoked to run a backup using the backup command. Commands are prefixed with a -cmd followed by the actual command. As you might be able to guess, the commandlet to fire off a backup is backup. The backup command requires a -source option which will almost always be…
-
Working with Postgres from the Command Line in Lion Server
Mac OS X Server 10.7, Lion Server, comes with a few substantial back-end changes. One of these is the move from SQLite3 to PostgreSQL for many of the back-end databases, including Wiki and Podcast Producer (collab), Webmail (roundcubemail), iCal Server and Address Book Server (caldav) and as the back-end to the newest service in Lion Server, Profile Manager (device_management). As such, it’s now important to be able to use PostgreSQL the way we once used SQLite3, when trying to augment the data that these databases contains, as there currently aren’t a lot of options for editing this data (aside from manually of course). Postgres has a number of commands that…
-
Debug Logging iCal
One of the tools in the iCal -> iCal Server troubleshooting toolbelt is to debug log HTTP connections. You can capture packets for port 8008 using tcpdump. In the following command, we’ll capture the packets over interface en0 for tcp port 8008 to a file called iCal.pcap: tcpdump -w iCal.pcap -i en0 tcp port 8008 We’ll then attempt to create a calendar entry in iCal or simply log into the server through iCal. CalDAV traffic will occur and then you can stop the tcpdump. In order to then read the tcpdump: tcpdump -nnr iCal.pcap Another option that can help to correlate traffic you see in the pcap from tcpdump is…
-
Mac OS X Server: CalDav Log Fun
The selected logfile does not exist. Ran into an interesting little problem again, where the iCal Server doesn’t create its log directory when you enable it. Not sure why this happens, but the first thing to do when you see this error is verify that the /var/log/caldavd directory is present on the system. If not: mkdir /var/log/caldavd Then, restart the service and see if access.log and error.log are created in this folder. If not: touch /var/log/caldavd/access.log touch /var/log/caldavd/error.log And for good measure: chmod 640 access.log chmod 640 error.log How did I know where those logs go? serveradmin settings calendar:ErrorLogFile; serveradmin settings calendar:AccessLogFile It’s therefore possible to actually decide you’d rather…
-
Mac OS X Server 10.5: Troubleshooting CalDAV
I originally posted this at http://www.318.com/TechJournal So you installed your new server and you’re having a few problems. Let’s look at the common issues and a few simple fixes for them. iCal will not start, with log entries that it is unable to create a virtual host: Check your host name. iCal is going to need the host name to be correct in order to start. Use scutil --get HostName and then make sure that the host name listed in the iCal Server settings is identical to this value. You setup a user, check the box in Workgroup Manager for Enable Calendaring and then save your settings but you get the following…
-
Mac OS X Server 10.5: Parsing and Formatting for CalDAV
I originally posted this at http://www.318.com/TechJournal A key aspect of any groupware solution is the ability to share calendars. Leopard server brings the long-awaited ability to share calendars to the Mac OS X Server platform. Leopard uses CalDAV as the back end protocol for Calendar sharing. CalDAV is currently supported by Facebook, Novell Evolution, Zimbra, Drupal, Microsoft Exchange, Kerio and now Mac OS X Server. CalDAV looks at each event as an HTTP resource, giving users the ability to view events in a web browser. Each event is stored in the iCalendar format. A typical event in the iCalendar format: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Apple Calendar//Calendar1//Charles Edge BEGIN:VTODO DTSTAMP:19980130T134500Z SEQUENCE:2 UID:uid4@host1.com ORGANIZER:MAILTO:riaa@us.gov…