I like to backup my Nextcloud calendars and addressbooks as *.ics/*.vcf files, because it is very easy to restore: just import the backed up *.ics/*.vcf file to the server or a client and the accidentally deleted data is back online.
calcardbackup downloads all available calendars/addressbooks from a Nextcloud instance as .ics/.vcf files. All downloaded files are then compressed to a single file with the current date in the filename.
Your Nextcloud instance is broken? No problem: as long as you have access to the database, calcardbackup is able to export all calendars and addressbooks that are in there.
calcardbackup is compatible with all currently released Nextcloud versions (and ownCloud >= 5.0) and has been tested under Debian, Ubuntu, FreeBSD, SunOS and Darwin. Shell access to the server is needed. But with the help of the included calcardbackup-wrapper.php there is possibly a way to run calcardbackup as well as Nextclouds occ command in shared hosting environments without shell access.
The configuration is quite simple: in most cases the path to the Nextcloud directory sufficient. It is not necessary to run the script with root privileges - in its default configuration it only needs to have read access to Nextclouds configuration file
config.php. At no point any data leaves the server.
(don’t use the repo at GitHub anymore as it is heavily outdated and contains some unfixed bugs!)
EDIT (17.01.2020): the repository moved to Codeberg:
EDIT (06.05.2021): calcardbackup
v2.0.0 might be able to run on your server even if you don’t have shell access to the server. Check out the section ‘Can I use this without shell access to the server?’ in the README of the repo.
Please note, that this text has been adapted several times to match the newest release of calcardbackup.