Lion OS Collaboration Services - Manually Backing Up and Restoring
In Lion server, the Collaboration services (Address Book, iCal, Profile Manager, Webmail, and Wiki) all store their data in PostgreSQL databases. Each service has it's own database with the exception of Address Book and iCal which share a database.
By default, this database is stored under /var/pgsql/. If you have enabled Time Machine backups, full database dumps are made daily (using pg_dumpall) to /Library/Server/PostgreSQL/Backup/. "serveradmin settings postgres" offers a way to get and set various parameters.
If you want to backup and restore the individual databases outside of Time Machine, you can do so in the command line.
(PLEASE NOTE: YOU SHOULD HAVE THE SERVICE STOPPED WHEN PERFORMING ANY OF THE BACKUP OR RESTORE COMMANDS LISTED BELOW!!!)
AddressBook and iCal:
Database name: caldav
BACKING UP:
$ sudo -s
(the -c flag on the pg_dump command here indicates that when we re-import the data, it should clear out ALL data from this database before importing, this prevents duplicate entries upon restoring)
RESTORING:
$ sudo -s
Database Name: device_management
BACKING UP:
$ sudo -s
RESTORING:
$ sudo -s
WebMail:
Database Name: roundcubemail
BACKING UP:
$ sudo -s
RESTORING:
$ sudo -s
Wiki:
Database Name: collab
BACKING UP:
$ sudo -s
RESTORING:
$ sudo -s