What’s the cleanest backup strategy for Nextcloud, just files and DB, or should I include config files too?

What’s the cleanest backup strategy for Nextcloud, just files and DB, or should I include config files too?

Hi, Not sure what is meant by cleanest? But anyway:

I am backing up the data directory, the file directory and the database. That saves everything.

If intererested, you may also use the scripts from this site:

All in german I am afraid, but the scripts are pretty easy to read.

1 Like
2 Likes

Thanks both @scubamuc , @Matthias_Koll ,

that’s helpful. I meant a simple but complete approach, something reliable to restore without unnecessary data.

Backing up the data directory, database, and config file makes sense, especially since the config holds paths, DB credentials, and trusted domains. I’ll check out both links.

I run Nextcloud as web application (not AIO in Docker) and backup everything using Borg backup with a dump of the database with a script.

So first the script will dump the database to a file and then the web root of Nextcloud which includes the data folder and the database dump file will be backed up with Borg. Since Borg will deduplicate and compress all data blocks, you can run that daily an still keep at least a couple of months of history since only new and changed data blocks will be stored in the backup repository.

1 Like