CardDAV Server : where data is stored?

The discussion lounge for add-on Synology packages.
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/su ... p?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
stephanet
I'm New!
I'm New!
Posts: 2
Joined: Sun Jan 04, 2015 2:06 pm

CardDAV Server : where data is stored?

Unread post by stephanet » Sun Jan 04, 2015 2:29 pm

Hi everyone,

Everything works fine with CardDAV syncing but where the adressbook's data is stored?

I dig into the package folders through SSH and i can't find anything. When we go to : IP:PORT/adressbook/... we can see the list of all the .vcf files but where are they? Is there a "private" database?

Thanks in advance.

User avatar
luckman212
Sharp
Sharp
Posts: 174
Joined: Thu May 12, 2011 3:17 am

Re: CardDAV Server : where data is stored?

Unread post by luckman212 » Tue Jan 13, 2015 6:22 am

+1 I would like to be able to periodically dump my CardDAV data to a mysql database, so I can query it for CallerID display on Asterisk. Any tips for where this data is stored or how to query it via console/ssh/cron ?
DS1515+, DSM 6.1.3-15152 u6

csimon
Versed
Versed
Posts: 267
Joined: Thu Aug 12, 2010 10:18 am

Re: CardDAV Server : where data is stored?

Unread post by csimon » Thu Jan 15, 2015 2:27 pm

Just a hunch - but since CardDAV server is an official application, if you use Backup to backup application data then it the backup file should be accessible in your backup location. It won't be a real-time copy but it might be in a format you can read for export to another database, and I guess Restore should be able to restore it too.

There is probably a hidden location for all the original application files, I don't know if anyone knows where they are? I think the Backup and Restore method is the only way you can get at MySQL/MariaDB databases, I'm not sure, I couldn't work out where they were anyway!

rlees85
Trainee
Trainee
Posts: 18
Joined: Sun Jul 15, 2012 7:51 pm

Re: CardDAV Server : where data is stored?

Unread post by rlees85 » Mon Feb 16, 2015 10:04 pm

For anyone else that finds this thread, the data is stored in the postgresql database. Open an SSH session and type:

Code: Select all

psql -U postgres -l
you will see the CardDav database. All the data is in there.

Also if you have 150+ contacts and your NAS is over 3 years old its too slow for purpose. When doing a sync it doesn't respond for up to a couple of minutes - most apps such as DAVDroid give up well before this point.

Using Baikal/MariaDB works perfectly.

stephanet
I'm New!
I'm New!
Posts: 2
Joined: Sun Jan 04, 2015 2:06 pm

Re: CardDAV Server : where data is stored?

Unread post by stephanet » Sat May 16, 2015 7:53 pm

Hi guys,

Thanks to rlees85's answer, I developed a PHP script to export all your contacts into .vcf files : https://github.com/StephaneTurquay/syno ... s-exporter

Just move index.php somewhere in your Web Station folder and execute it.

Feel free to send me your feedbacks. Thanks

Briolet
Student
Student
Posts: 65
Joined: Sun Jun 23, 2013 4:47 pm

Re: CardDAV Server : where data is stored?

Unread post by Briolet » Mon Feb 29, 2016 12:00 am

@stephanet: interesting script. I had problems running php on my nas, so I translated it into Python.

Now, looking at the output, I see that there are line missing in this vCards output.

When I export the vCards from Apple contacts, every card also has a line: "CATEGORIES:" and a line: "UID:", Those lines are not exported with the "pg_dump -O -U postgres caldav -t addressbook_object -a" command. Which means that you loose the categories a vCard belongs to.

The categories are synchronised correctly between my macs. So they are there in the database, only not in this dumpfile.

Briolet
Student
Student
Posts: 65
Joined: Sun Jun 23, 2013 4:47 pm

Re: CardDAV Server : where data is stored?

Unread post by Briolet » Sun Mar 06, 2016 12:50 pm

rlees85 wrote:Also if you have 150+ contacts and your NAS is over 3 years old its too slow for purpose. When doing a sync it doesn't respond for up to a couple of minutes…
I had the same experience. With 300+ contacts and Apple-Contacts, it took 30-60 seconds to open or close a contact for editing. Today I copied my contacts to my old 212J with DSM 6.0 RC. Opening and closing the same contacts took now only 1-3 seconds. So, when DSM 6.0 will be officially released, we will have a much faster CardDAV.

The new CardDAV application will also have an import and export function.

Post Reply

Return to “Official Synology Packages”