#40630·dolibarr

Documents backup (step 2) embeds all previous database dumps, archive grows at every backup

Author: Steph501Created Sep 21, 2026Updated Sep 21, 2026

Bug

The documents backup (Home > Admin tools > Backup, step 2 "Backup of documents") archives the whole documents directory. It excludes its own previous archives (admin/documents) but not the database dumps produced by step 1 or by the scheduled job MakeLocalDatabaseDump, which are stored in admin/backup. Every documents archive therefore embeds all the database dumps present at that time, and the archive grows at each backup.

Dolibarr Version

22.0, 23.0, 24.0, develop (same exclusion list in export_files.php)

Environment PHP

any

Environment Database

MySQL / MariaDB (mysqldump)

Steps to reproduce the behavior and expected behavior

  1. Home > Admin tools > Backup, run step 1 (database backup) two or three times: mysqldump_*.sql.gz files appear in documents/admin/backup. The scheduled job MakeLocalDatabaseDump produces the same files.
  2. Run step 2 (backup of documents), zip or tar.gz.
  3. Open the archive: it contains admin/backup/mysqldump_*.sql.gz, all of them.
  4. Run step 1 then step 2 again: the new documents archive is bigger than the previous one by the size of the new dump.

Expected: the documents backup should not embed backup files, as it already does for its own previous archives (admin/documents).

Real case on a production instance (Dolibarr 19.0.3, shared hosting): a 63 GB documents archive containing 47 GB of database dumps (168 files left by the scheduled job) for 12 GB of actual documents.

Attached files

No response