Syncronizing your Mac Address Book with Communigate

So, I got to wondering if I could 'sync' my address book out of my Communigate system with my MacBook Pro.  A little digging and I found that the Address Book application has an import feature. It is able to handle csv, ldif, and vcard.

I brought up my Communigate web interface and took a look at Pronto. I couldn't find any way to export the data from the address book. So, after some thought, I decided to check the storage structures for Communigate. In the /var/Communigate/Accounts directory, I check inside my account area. There was a Contacts.mbox file.

This file is formated with some mbox header information right on top of standard vcard structure.

So, I just copied the Contacts.mbox file to my laptop and did a little magic. I ran this command:

cat Contacts.mbox | awk '/^BEGIN:/,/^END:/ { print $0 }' > Contacts.vcf

The thing to note here is that the extension should be 'vcf'. You are using the 'awk' program to find just the data that is part of the vcard. It starts with BEGIN: and ends with END:. Anything that matches that, just print the whole line and output all of that to Contacts.vcf.

Once this file had been created, it was a simple matter to start Address Book and select 'File', 'Import', 'vCards' and point the the Contacts.vcf file. It is even kind enough to recognize dups and all for an 'update all' scenerio. So, any changes that happen in Communigate can be sync'd to my OS X Address Book application. 

Overall, this was about 30 minutes from start of looking to finding the parts, writing the 'awk' line, importing the data, and writing this blog. I was hoping for something simple, and I think this is pretty simple. The LDAP format might be something else to look into as Communigate has an LDAP repository, but I don't need bi-directional, and I didn't want to study that hard on a saturday .