Dolibarr backup fails: message by message
Admin Tools > Backup failing in Dolibarr 24: command not in the whitelist, Gzip not available, Error 2, failed to write in directory, mysqldump "Deprecated program name" with MariaDB 11. Each message reproduced on Dolibarr 24.0.1 and 24.0.3, with the verified fix.
Want someone to look at your instance? Diagnosis, fixed price €90.
What was checked (versions, tests, code read)
Tests on 15/11/2026 in the interface (driven browser), on Dolibarr 24.0.1 and 24.0.3 under Docker. Steps 1 (database) and 2 (documents) run with each compression: with no command list, with the list written by the 24.0.1 installer, with the 24.0.3 one and with a shorter list. Backup folders given to another user (Linux volume), then given back to www-data. "Deprecated program name" warning read from the real mysqldump of MariaDB 11.4.13, then reproduced in Dolibarr with a script that prints it before running mariadb-dump. Fix through the "Full path to mysqldump command" field. Archive contents listed. Messages read in English, French and German. Dolibarr 22.0.5, 23.0.4, 24.0.1, 24.0.2 and 24.0.3 code read (core/class/utils.class.php, admin/tools/export_files.php, admin/tools/dolibarr_export.php, install/step1.php).
Admin Tools > Backup makes, in two steps, a copy of the database (step 1) and an archive of the documents folder (step 2). When it fails, the message is often technical, and forum answers do not always say which version is concerned.
This guide was written on 15 November 2026. We reproduced each message on Dolibarr 24.0.1 and 24.0.3 under Docker, then checked the fix. For the full backup and restore method, see backing up and restoring Dolibarr.
The messages at a glance
| Message | Version | Verified cause | Tested fix |
|---|---|---|---|
| Error tar generation return Command … ’ ‘documents’ is not in the whitelist of allowed commands | 24.0.1 | 24.0.1 defect | Zip compression, or 24.0.2+ |
| Error tar generation return Error 2 | 24.0.1 | documents/admin/temp folder missing |
create the folder, Zip, or 24.0.2+ |
| Gzip (Not available: command tar, gzip not allowed) | 24.0.2+ | tar and gzip missing from the conf.php list | add them to the list |
| Failed to write in directory | 24 | admin/backup folder not writable |
give the folder back to the web server |
| Error moving generated archive to …/admin/documents | 24 | admin/documents folder not writable |
give the folder back to the web server |
| The command you are trying to run is not in the list of allowed commands… | 24 | backup program missing from the list | add it, or change program |
| mysqldump: Deprecated program name… use ‘/usr/bin/mariadb-dump’ instead | MariaDB 11 | warning taken for an error | path to mariadb-dump |
1. The list of allowed commands (conf.php)
Several messages come from one setting: $dolibarr_main_restrict_os_commands, in conf.php (in
htdocs/conf/). It is the list of programs Dolibarr is allowed to run. The web installer writes it
itself; according to its code (versions read):
| Installed with | List written by the installer |
|---|---|
| 22.0.5, 23.0.4, 24.0.1 | mariadb-dump, mariadb, mysqldump, mysql, pg_dump, pg_restore, clamdscan, clamdscan.exe (+ ls in 24.0.1) |
| 24.0.2, 24.0.3 | the same, plus tar, gzip, bzip2, zstd |
In 22.0.5 and 23.0.4, step 2 did not check this list (read in the code). Since 24, it does: an older
installation, once upgraded, keeps its list without tar.
The official Docker image does not write this list (checked in 24.0.1 and 24.0.3): the messages related to the list do not concern it, unless you added it.
2. Gzip “Not available” (24.0.2 and later)
With the old list, Dolibarr 24.0.3 no longer crashes: it greys out the formats that need tar and
explains why. Only Zip remains.

What to do: in conf.php, add the commands at the end of the list, for example:
$dolibarr_main_restrict_os_commands='mariadb-dump, mariadb, mysqldump, mysql, pg_dump, pg_restore, clamdscan, clamdscan.exe, ls, tar, gzip, bzip2, zstd';
Tested: after this change and a page reload, Gzip was available again and the archive was created. In our container, Bzip2 and Zstd stayed “Not available”: something else was missing on the server, which we did not look for. Gzip or Zip are enough.
3. “… is not in the whitelist of allowed commands” (24.0.1)
Full message under Docker:
Error : Error tar generation return Command www’ ‘documents’ is not in the whitelist of allowed commands
(On the forum, with documents in /var/lib/dolibarr: dolibarr' 'documents'.)
This is a 24.0.1 defect: it checks the whole tar command line instead of just the program name.
It shows up as soon as the list exists in conf.php. Tested:
- with the 24.0.1 list: the error;
- with
tar, gzip, bzip2, zstdadded: still the error; - with Zip: the archive is created.
What to do: choose Zip in step 2, or upgrade to 24.0.2 or later (see upgrading Dolibarr). The 24.0.2 code only checks the program name.
4. “Error tar generation return Error 2” (24.0.1)
On a new 24.0.1 Docker installation, with no list at all, the first Gzip archive failed with this
message. Cause found: tar first writes into documents/admin/temp, and that folder did not exist
yet. Once created, the same archive succeeded. 24.0.2 creates the folder itself (read in the code).
What to do: create the admin/temp folder in the documents folder, as the web server user, or
choose Zip, or upgrade.
5. “Failed to write in directory”
Tested by giving the backup folders to another user, as when a host folder is mounted into Docker:
- step 1: “Error : Failed to write in directory”;
- step 2: “Error : Error moving generated archive to /var/www/documents/admin/documents”.
Backups go into documents/admin/backup (database) and documents/admin/documents (archive), which
must belong to the web server user. In Dolibarr 22.0.3, a forum user saw “ERROR: unable to write in
the directory” in the same situation.
What to do under Docker (official image): the web server user is www-data, number 33 (checked
in the image). On the host, give it the folder mounted on /var/www/documents:
sudo chown -R 33:33 /path/to/documents
Tested: both steps then succeeded. Avoid chmod a+rwx, suggested on the forum: it opens the folder to
every user of the machine.
6. “… is not in the list of allowed commands”
Error : The command you are trying to run is not in the list of allowed commands defined in parameter $dolibarr_main_restrict_os_commands in the conf.php file.
This message comes from step 1: the program set in “Full path to mysqldump command” is not in the
list. Tested with mariadb-dump and a list cut down to mysqldump, mysql, pg_dump, pgrestore (the
one quoted on the forum for a Debian installation).
What to do: add the program name to the conf.php list, or go back to a program that is in it.
7. “mysqldump: Deprecated program name” (MariaDB 11)
Error : mysqldump: Deprecated program name. It will be removed in a future release, use ‘/usr/bin/mariadb-dump’ instead
With MariaDB 11, mysqldump is only an old name for mariadb-dump. We checked it with MariaDB
11.4.13: it prints this warning, then makes the complete backup. Dolibarr 24.0.3, however, takes the
warning for an error: in our test, the failed file stayed in the list with the .err extension.
What to do: click Show advanced options and put /usr/bin/mariadb-dump in Full path to
mysqldump command, then Generate backup.

Tested: backup successful, and the path is kept for the next times. The .err file can be deleted.
mariadb-dump must be in the conf.php list if there is one (it is in the list written by the
installer, see part 1).
If the path set does not exist, Dolibarr 24.0.3 does not block: it tries plain mysqldump and says so
(“Note: Full path was not found so we used the alternative value mysqldump”).
Good to know: the documents archive no longer contains the database
Since 24.0.2, step 2 excludes the database backups made in step 1 (the page says so: “This will
not include all the dump files generated in Step 1”). Checked by listing the archives: in 24.0.1, the
Zip archive contained admin/backup/…sql.gz; in 24.0.3, neither the Zip nor the tar.gz did.
Download both files, not just the archive.
What we did not test
Windows (Doliwamp, XAMPP) and its path to mysqldump, the “Failed to run external command…” message that can show up there, running out of memory with the “MySQL Dump (php)” method on a large database, the scheduled backup job, PostgreSQL and shared hosting.
Summary
- Several errors come from the
$dolibarr_main_restrict_os_commandslist inconf.php. - 24.0.1: Gzip archive error (whitelist or Error 2)Zip, or 24.0.2+.
- 24.0.2+: Gzip greyed outadd
tar, gzip, bzip2, zstdto the list. - “Failed to write”:
admin/backupandadmin/documentsfolders to the web server (33:33 under Docker). - MariaDB 11:
/usr/bin/mariadb-dumppath in the advanced options. - Since 24.0.2, download the database and the archive: one no longer contains the other.
Next
Backing up and restoring Dolibarr, installing Dolibarr with Docker Compose and upgrading Dolibarr.
If your backup still fails, the €90 diagnosis means looking at your installation with you for an hour, then giving you in writing what is blocking and what the fix would cost.
Frequently asked questions
Why does the Dolibarr backup say "is not in the whitelist of allowed commands"?
In Dolibarr 24.0.1, the documents archive in Gzip or Bzip2 fails as soon as conf.php contains the $dolibarr_main_restrict_os_commands parameter: Dolibarr checks the whole command line instead of just the word tar. Tested: adding tar to the list changes nothing. Choose Zip compression, or upgrade to 24.0.2 or later.
Why is Gzip "Not available: command tar, gzip not allowed" in the Dolibarr backup?
Since Dolibarr 24.0.2, the formats that need tar are greyed out when tar and gzip are not in $dolibarr_main_restrict_os_commands in conf.php. Installations made before 24.0.2 have a list without tar. Tested on 24.0.3: after adding tar, gzip, bzip2, zstd to the list, Gzip is available again and the archive is created.
How do I fix "mysqldump: Deprecated program name" in Dolibarr?
With MariaDB 11, the mysqldump program prints this warning and Dolibarr treats it as an error. In Admin Tools > Backup, click "Show advanced options" and put /usr/bin/mariadb-dump in "Full path to mysqldump command". Tested on 24.0.3: the backup succeeds and the path is kept for the next ones.