CardDAV (and CalDAV) sync?

Sorry if I ask the obvious, but I’m having real trouble understanding how to sync Nextcloud with CardDAV-servers.

EDIT: To clarify: What I want to do is keep Contacts in sync with the mail account I use for Nextcloud.

I run Nextcloud 18.0.4, Apache 2.4.38 and Postgres 11.7 on Debian 10 with 64-bit kernel version 4.19.

What kind of answer do you expected without providing any information about the used email client? For Thunderbird you can e.g. install the Cardbook add-in, on an Android phone you can use DAVx5 to sync contacts, etc., etc.?!

Ah, sorry - I don’t mean syncing from Nextcloud to a device; I mean syncing contacts to Nextcloud from the same source as I sync email from, for example Google.

To be concrete:
I sync mail from Google into Nextcloud, and I want to sync the contacts too. That way I can use Nextcloud for mail when I work in Nextcloud, but I can use a normal mail client, such as Thunderbird, when I don’t use Nextcloud.

If I can’t sync contacts, then I will end up with some contacts stored in my Google account and some contacts stored in Nextcloud, forever having to look up emails in order to find what the address to my contact is.

Most likely you aren’t syncing your email with Nextcloud but you’re using the Nextcloud mail app to access the Google mail server.

Nextcloud has been build to be a safe harbor for your data. This normally implies not to sync any data with Google and Co. because the main aim is to prevent to store data on external servers. You can move your contact and calendar data to Nextcloud and use e.g. Davx5 on Android to directly sync the data with your device.

You’re right, of course - but at the same time missing the point somewhat; I have a Google mail account that I access from Nextcloud, and as is normal, that same account holds calendar data and contacts data.

I may have expressed myself inaccurately in trying to be more exact what I want to do, but the original question was pretty straightforward; how do I connect (sync is the wrong word, sorry) to CardDAV servers from Nextcloud?

I guess from your answer that this isn’t implemented, and that’s fine of course - volunteer programmers are a finite resource, and we should all be grateful for the effort they put in - but it wasn’t obvious to me that it wasn’t implemented, as mail and contacts are pretty tightly integrated functionality.

I would think this is more of a question of prioritizing where to invest effort? Ideally, if you want to provide independence from the big cloud service providers then good integration is a facilitator; otherwise the transition may be too abrupt, and keep people from taking the leap.

Thank you for your time and answer, though!

Nextcloud doesn’t contain a function to sync its data with other CardDAV or CalDAV servers nor does it contain a CalDAV client which can connect to an external CardDAV server. You can only import vcf files of your contacts manually or subscribe to an external calendar ics files.

If you want to keep two servers in sync you have to use an external tools like vdirsyncer.

Thanks for the tip on vdirsyncer by the way @j-ed.

Vdirsyncer seems quite usable, but in the end I decided simply to disable mail, calendar and contacts and use a mail client in parallell with Nextcloud.

Not ideal, but fully workable.