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

**URL:** <https://help.nextcloud.com/t/what-s-the-cleanest-backup-strategy-for-nextcloud-just-files-and-db-or-should-i-include-config-files-too/233939>\
**Category:** ℹ️ Support\
**Created:** [October 13, 2025, 7:25am UTC](https://help.nextcloud.com/t/what-s-the-cleanest-backup-strategy-for-nextcloud-just-files-and-db-or-should-i-include-config-files-too/233939 "2025-10-13T07:25:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![marvin\_accuwebcloud](https://help.nextcloud.com/letter_avatar/marvin_accuwebcloud/32/5_5575768a8748004e209b776fc1b2916d.png) [@marvin\_accuwebcloud](https://help.nextcloud.com/u/marvin_accuwebcloud)\
**Post date:** [October 13, 2025, 7:25am UTC](https://help.nextcloud.com/t/what-s-the-cleanest-backup-strategy-for-nextcloud-just-files-and-db-or-should-i-include-config-files-too/233939/1 "2025-10-13T07:25:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Matthias\_Koll](https://help.nextcloud.com/user_avatar/help.nextcloud.com/matthias_koll/32/74265_2.png) [@Matthias\_Koll](https://help.nextcloud.com/u/Matthias_Koll)\
**Post date:** [October 13, 2025, 9:18am UTC](https://help.nextcloud.com/t/what-s-the-cleanest-backup-strategy-for-nextcloud-just-files-and-db-or-should-i-include-config-files-too/233939/2 "2025-10-13T09:18:52Z")

</div>

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:

> **[Nextcloud Backup/Restore: Version 3.4.0 erschienen » DecaTec](https://decatec.de/home-server/nextcloud-backup-restore-version-3-4-0-erschienen/)**
>
> Version 3.4.0 der Nextcloud Backup-/Restore-Skripte unterstützen nun Remote-Datenbanken und bieten Verbesserungen bei Netzwerk-Speichern als Backup-Ziel.

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

---

<div class="post-metadata">

**Author:** ![scubamuc](https://help.nextcloud.com/user_avatar/help.nextcloud.com/scubamuc/32/63165_2.png) [@scubamuc](https://help.nextcloud.com/u/scubamuc)\
**Post date:** [October 13, 2025, 9:19am UTC](https://help.nextcloud.com/t/what-s-the-cleanest-backup-strategy-for-nextcloud-just-files-and-db-or-should-i-include-config-files-too/233939/3 "2025-10-13T09:19:16Z")

</div>

> [@101: backup what and why (not how)](https://help.nextcloud.com/t/101-backup-what-and-why-not-how/217496/5):
>
> I found another backup guide which might help some of you [Awesome Backups 1 - What actually makes a good backup?](https://tobias.knoeppler.org/blog/01-awesome-backups-1/)[https://tobias.knoeppler.org/blog/02-awesome-backups-2/](https://tobias.knoeppler.org/blog/02-awesome-backups-2/) I don’t agree with some details but it a good tutorial if you like the approach.

---

<div class="post-metadata">

**Author:** ![marvin\_accuwebcloud](https://help.nextcloud.com/letter_avatar/marvin_accuwebcloud/32/5_5575768a8748004e209b776fc1b2916d.png) [@marvin\_accuwebcloud](https://help.nextcloud.com/u/marvin_accuwebcloud)\
**Post date:** [October 13, 2025, 10:03am UTC](https://help.nextcloud.com/t/what-s-the-cleanest-backup-strategy-for-nextcloud-just-files-and-db-or-should-i-include-config-files-too/233939/4 "2025-10-13T10:03:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![awelzel](https://help.nextcloud.com/user_avatar/help.nextcloud.com/awelzel/32/74585_2.png) [@awelzel](https://help.nextcloud.com/u/awelzel)\
**Post date:** [October 13, 2025, 10:05am UTC](https://help.nextcloud.com/t/what-s-the-cleanest-backup-strategy-for-nextcloud-just-files-and-db-or-should-i-include-config-files-too/233939/5 "2025-10-13T10:05:24Z")

</div>

I run Nextcloud as web application (not AIO in Docker) and backup everything using [Borg backup](https://borgbackup.readthedocs.io/en/stable/) 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.

---

<div class="post-metadata">

**Author:** ![scubamuc](https://help.nextcloud.com/user_avatar/help.nextcloud.com/scubamuc/32/63165_2.png) [@scubamuc](https://help.nextcloud.com/u/scubamuc)\
**Post date:** [October 13, 2025, 10:06am UTC](https://help.nextcloud.com/t/what-s-the-cleanest-backup-strategy-for-nextcloud-just-files-and-db-or-should-i-include-config-files-too/233939/6 "2025-10-13T10:06:47Z")

</div>

> [@marvin\_accuwebcloud](#):
>
> simple but complete approach, something reliable to restore without unnecessary data.

> **[GitHub - scubamuc/scubamuc.github.io: SCUBA's GitHub Site](https://github.com/scubamuc/scubamuc.github.io#lxc-container-snapshot--backup--restore)**
>
> SCUBA's GitHub Site

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [January 11, 2026, 10:07am UTC](https://help.nextcloud.com/t/what-s-the-cleanest-backup-strategy-for-nextcloud-just-files-and-db-or-should-i-include-config-files-too/233939/7 "2026-01-11T10:07:21Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
