How can I keep Contacts in sync with CardDAV?

Hello,


I am trying to find a way to automatically keep my contacts (and calendars, but will focus on contacts here) in sync with external devices.

Currently I have host a CardDAV server using Owncloud. I have my OS X Contacts linked to the CardDAV account, but this results in TWO separate databases of contacts. The local one and the CardDAV one. I have found no easy way to keep them in sync. I need the remote one in order to sync other (Android) devices to it.

So I am now looking at using OS X Server and ditching Owncloud. Just having the local contacts share from a local OS X Server. With Server being only $20, I am fine with going that way. As I don't really need my data synced to the cloud. It's fine to sync over my local network.


For some smart Apples out there... I have a few questions:

1) Is there a way to keep local contacts and remote CardDAV contacts synchronised?

2) (...if not) Is there a way to use OS X Server to run as a CardDAV server which my other devices can then access over the local network?


I have installed Server. And I activated sharing of contacts. But I could find no info/instructions on how to access that from a client device. What is the server URL for the CardDAV server?


Thank you for helping with this. Very keen to get all my devices sharing their data WITHOUT using third-party services like Google, etc.

MacBook Pro, OS X Yosemite (10.10.3), 256 SSD, 1TB HDD, 8GB RAM, Matt

Posted on Apr 22, 2015 7:52 PM

Reply
10 replies

Apr 22, 2015 7:59 PM in response to InspiredLife

You should have two copies, but they should be in sync. cardDAV (and calDAV) is designed to store the "master" on a server (in the cloud), and merge any changes that any device makes to all devices.

Even if you ran Server with Contacts support, the Server would maintain the contacts, and sync them to your "local" copy in your user account.


Did you add your cardDAV server to Internet Accounts?

Apr 22, 2015 8:13 PM in response to InspiredLife

In Contacts, show the Groups (view menu) if not already showing.

Do you have two sections, one named On My Mac, and another named for your CardDAV server?

If so, the On My Mac ones are not part of the CardDAV server, although they may be duplicates of the ones on the CardDAV server.

Check the you have all of your contacts in the CardDAV server Group. If so, Delete the duplicate ones from the On My Mac group.


The On My Mac group is a true "local" account.

The group named for your server is the synced set of contacts.

Apr 22, 2015 8:19 PM in response to Barney-15E

Hi Barney,

Yes, there are two sets of contacts.

ON MY MAC and CardDAV

So, once I have the CardDAV in place, I should just delete the ON MY MAC set? I was hoping to have that set sync with the remote set. But perhaps that's not strictly necessary. I was perhaps just feeling iffy about ONLY using the CardDAV set. But thinking it through, I realise I have a full local copy of the CardDAV set. So even if the CardDAV server died (and all data was lost on it) I would still have my local CardDAV copy.


Now I just have to figure out how to determine which contacts are in the ON MY MAC set and not on the CardDAV Server. (i.e. merge the two sets, without creating duplicates).


ALSO... To anyone else reading this... I am still very interested in figuring out the answer to Question #2. As I would like to ideally do away with the remote CardDAV server, now that I have the $20 OS X Server.

Apr 22, 2015 8:27 PM in response to InspiredLife

Now I just have to figure out how to determine which contacts are in the ON MY MAC set and not on the CardDAV Server. (i.e. merge the two sets, without creating duplicates).

Create a Smart Group with criteria, Card is not a member of <CardDAV server>.


I don't have Server, so can't help, much. But, you do realize without opening your Mac up to the world, you cannot access Server from outside your network. Not a huge deal if you don't mind changes only occurring when you get back home.

While there are ways to make your server available outside your home network, your ISP likely will not like it, and unless you know what you are doing, you will create huge security issues for yourself.

Apr 22, 2015 9:40 PM in response to Barney-15E

Thanks. I'll try that Smart Group method. Hadn't thought of that (obviously 😝).

Re: Server — Was just planning to run it locally. I have no need for syncing data remotely, and I am keen to eliminate having my data on remote servers entirely. I'll continue investigating how to access the Server CardDav and CalDav instances. Just looking for the URL to plug into client (Android) devices.


You've been very helpful. Thanks. Much appreciated.

Apr 22, 2015 10:16 PM in response to Barney-15E

Barney-15E wrote:


Now I just have to figure out how to determine which contacts are in the ON MY MAC set and not on the CardDAV Server. (i.e. merge the two sets, without creating duplicates).

Create a Smart Group with criteria, Card is not a member of <CardDAV server>.


Unfortunately a Smart Group with this criteria doesn't seem to do much. If I select "is not a member of [the CD server]" it reverts to showing me all the cards that are in ON MY MAC (1225 total). If I set it to show me those cards that are not a member of ON MY MAC (as a test), it presents all the server based contacts (1176 total).

Apr 23, 2015 4:17 AM in response to InspiredLife

You're right. Now that I think through it, I'm not sure it is possible as you have duplicates.

There is a "Look for Duplicates" command, but I think it limits itself to duplicates in the same account.


You could export all of the On My Mac contacts to vCard, then delete them out of Contacts.

Then, go into Contacts Preferences and set you CardDAV server as default.

Double-click the exported vCard to import. It should try to import them into your CardDAV server.

Click the button to Review Duplicates when the import dialog appears.

You can then click the Apply to All checkbox and choose Keep Old. That should import all the non-duplicates and leave the originals on the cardDAV server account.

I would then run the Look for Duplicates with the CardDAV account selected in Contacts group pane. If you have any that were not identified as duplicates during the import, you should find them with that.


As to the Server, there is a Server forum, here. You might ask there.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I keep Contacts in sync with CardDAV?

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