Calendar deleted accidentely

Hello, on my Iphone my Calendar appeared to be visible in the Reminder app. I didn’t expect the NC Calendar would appear there and I deleted the entry ‘Agenda’ which was my entire Calendar!
Is there a way to get it back? It looks like there is no such thing as retention which I discovered there is for regular files.
Please help, all my appointments are gone!

Ralph

If you have a database backup, just make a databasebackup an restore the calendar tables.

If you have OwnBackup installed on your Nextcloud, you can do the restore from the admin panel.

Before restoring, make a actual databasebackup.

I’m afraid, but if you don’t have any backups gone means gone in this case.

We are working on a calendar deletion undo for the web interface, but I’m afraid that won’t help you either when deleting it via an iPhone. https://github.com/nextcloud/calendar/issues/12

@jan IIRC you asked me to automatically make calendars store events and todos on creation. Maybe we should rethink that

First off, sorry that happened. Let’s see what we can do.

Did you delete it using your phone or the web interface?

@georgehrke the Calendar should only be deleted when deleting it from the web itnerface, no? Storing events and todos on creation is proper, that’s what Apple also does.

well, when the DAV backend receives a DELETE request, why should it not delete it?

1 Like

Did you delete it using your phone or the web interface?

@erwee said on the iPhone, so it’s nothing we can fix in the web interface.

@georgehrke the Calendar should only be deleted when deleting it from the web itnerface, no?

No, the calendar should be deleted no matter which client sends the delete request.
You can also delete entire folders via WebDav and don’t have to use the web interface.

Maybe we could consider adding a ‘CalDAV-Trashbin’ and 'CardDAV-Trashbin.
But I don’t see that being implemented before Nc 12 or 13

1 Like

Yeah, I mean just like for Files we need that safety net for Calendar & Contacts. It should be integrated into the app, not be separate.

cc @bjoern regarding the »Deleted files« app.

2 Likes

Hello Soko,
Thank you, I wish I had a database backup. I only have a backup of the config, not the data directory. (It contains 1TB of movies and music,where actually the ‘cloud’ act as a backup for these)
But I think I will schedule a backup in some way to export the Calendar. I was really suprised that just by deleting an entry in ‘Reminders’ on my iphone, swiped the whole Calendar in my Nextcloud :frowning:

Kind regards,
Ralph Willemsen
Arnhem, Netherlands

Hello, thank you for your reply. I deleted it from my Iphone, since there was an entry in my Reminders ‘app’ that I didn’t know or put there, but this appeared to be the (whole) calendar of my Nextcloud :worried:
Kind regards,
Ralph

The question is if we want to implement it in the dav app or the calendar app (given that the dav app sends the necessary hooks). But anyway, let’s discuss the technical details at GitHub. I’ll create an issue.

Without backups, that’s a nogo :frowning:

The database is not in the datadirectory. For Backup you can use ownbackup witch makes it very comfortable, or u use a skript like this witch can be run by a cronjob:

#!/bin/bash
MONAT=`date +%m`
DATZEIT=`date +%d%H%M`
mkdir -p /media/bu/sql/$MONAT
mysqldump -u root -pS2014senBvdL#! owncloud > /media/bu/sql/$MONAT/$DATZEIT.sql

If it was just a reminder for an appointment, I can’t believe that :frowning:

Did You had a look into your database, if the calendar entries are realy deleted?
The calendar related entries are in these tables:

oc_calendarobjects
oc_calendars
oc_calendarsubscriptions 

The whole calendar is deleted, if there are no entries under calendarobjects.
Before manipulationg the database: Make a backup…

I marked the backup script as solution. @georgehrke can you still link the feature request from github once you’ve created it?

Here is the issue in the Nextcloud server repo: https://github.com/nextcloud/server/issues/1662

this same thing happened to my. But now it is 2021 and I am on NC20. Is there a thing I can do to get my calander back?

Do you have a backup of the database?

Yes, but I am unsure how dated it is and I am not too experienced with handling databases…

You can try to restore the database-dump to a database and export the calendar with calcardbackup. Maybe this helps as starting point in accomplishing that task: Calcardbackup: bash script to backup Nextcloud calendars and addressbooks as *.ics/*.vcf files - #10 by Bernie_O

thank you for trying to help @Bernie_O and apologies for never getting back to you.

In the end I decided to move on and just accept that the calender has vanished: I am too busy to dive into this debugging rabbit hole…

But I appreciate your effort and time to help me