Database: color of an event

Can someone tell me, where the color of an event is stored in the database.
I want to change the color of some special events by hand.

Every hint is useful.
Regards, Thilo

That is within calendardata in the table oc_calendarobjects (your table prefix might be different from oc_).

Ok, that’s a binary field. Well, I guess that’s why I can’t do the changes of the color quickly by sql.
BTW: How is the calendardate encoded? I found your amazing backup-script but didn’t understand how the decoding works. I’m not a bash pro.

Thanx Bernie

1 Like

It is basically just text with eventually some BASE64 encoded binary sections.

Well, maybe not quickly with a sql statement, but you can read the data and store it somewhere (in a variable or text file) with e.g.:

SELECT calendardata FROM [DATABASE].[PREFIX]calendarobjects WHERE uri = "[URI]";

You then could add the following line (if it is already in the calendarobject, then you need to change the value instead of adding it):


just before


and write the data back to the database. Done.

Take into account, that according to RFC 5545 line breaks need to be CRLF.

Another approach would be to open the Nextcloud calendar app as well as the browser console, change the color of an event and use the http request from the console as a template for a curl command. I personally would prefer that approach instead of directly manipulating the database.

1 Like