Backup strategy for Faveo Helpdesk deployed via faveo-helpdesk-docker-v2
(Docker Compose), modeled on the existing on-prem backup-script but
adapted for a containerized deployment. This project only reads
faveo-helpdesk-docker-v2’s .env / docker-compose.yml for context - it
never modifies either faveo-helpdesk-docker-v2 or backup-script.
Client-facing setup steps are published at https://docs.faveohelpdesk.com/docs/installation/providers/enterprise/docker-backup-script/ (source:
_docs/installation/providers/enterprise/docker-backup-script.md). This file is the technical/maintainer reference: design rationale, every config field, and troubleshooting.
Looking at faveo-helpdesk-docker-v2/docker-compose.yml:
HOST_ROOT_DIR) and the storage/ folder are host
bind-mounts (./${HOST_ROOT_DIR} and ./storage), so they already live
on the host filesystem as plain files. They’re backed up directly with
tar on the host - no container access needed, and it also picks up
storage/ automatically since it’s a mounted subfolder of the project.db-volume) is an external named Docker volume, not a
host bind-mount. Rather than locating and tar’ing the volume’s data
directory (which is fragile - its host path depends on the Docker storage
driver and needs the daemon stopped for a consistent raw copy), the script
runs mysqldump inside the running faveo-mysql container via
docker exec. This gives a consistent, engine-agnostic SQL dump while the
stack stays up.So: filesystem from the host, database from the container.
docker-backup-script/
├── config.py # fill in paths/credentials here
├── docker_backup_common.py # shared backup/upload/purge helpers
├── dockerlocal.py # backup, store locally only
├── dockerftp.py # backup + upload to FTP
├── dockerscp.py # backup + upload to SFTP/SCP
├── dockersmb.py # backup + upload to an SMB share
├── cron.sh # interactive cron installer
└── README.md # this file (maintainer reference)
config.py ships ready-to-edit, split into # Faveo Info, # FTP Cred,
# SFTP/SCP Cred and # SMB Cred sections - no copying/renaming needed.
Each docker*.py script only reads the variables it actually uses, so a
credential section can be left at its placeholder values if that upload
method isn’t used.
Each docker*.py script does, in order: MySQL dump (via docker exec) →
filesystem tar (host bind-mounts) → upload (if applicable) → remote retention
purge (if applicable) → local retention purge.
docker exec
against the Faveo containers and read the host bind-mounted app/storage
directories.python3, tar, gzip, docker (daemon already running the Faveo stack).dockerscp.py additionally needs the paramiko Python module:
apt install python3-paramiko (pip3 install is blocked
on Debian 12+/Ubuntu 24.04 with “externally-managed-environment”)dnf install epel-release && dnf install python3-paramikodockersmb.py additionally needs the smbclient CLI:
apt install smbclientyum install samba-clientconfig.py field reference| Field | Required? | Meaning |
|---|---|---|
PROJECT_DIR |
Yes | Absolute path to this client’s faveo-helpdesk-docker-v2 checkout (must contain docker-compose.yml and .env). Independent of where docker-backup-script itself lives. |
BACKUP_DIRECTORY |
Yes | Absolute path where local backup archives are written. |
LOG_FILE |
Yes | Absolute path to the backup log file. |
LOCAL_BACKUP_RETENTION |
No | Days to keep local backups (default 5 / (24*60) ≈ 5 minutes, matches backup-script’s default - raise this for real use). |
BACKUP_RETENTION |
No | Days to keep backups on the remote target (FTP/SFTP/SMB). Unused by dockerlocal.py. |
.env overrides (leave blank unless needed)These are not required inputs - by default they’re read straight out of
PROJECT_DIR/.env, which every faveo-helpdesk-docker-v2 deployment already
has filled in (DOMAINNAME, HOST_ROOT_DIR, MYSQL_DATABASE,
MYSQL_ROOT_PASSWORD). The *_OVERRIDE fields exist only so a maintainer can
force a different value without touching that .env file:
| Field | Default (if left "") |
When to set it |
|---|---|---|
DOMAINNAME_OVERRIDE |
.env’s DOMAINNAME |
.env is missing/wrong and can’t be fixed. |
HOST_ROOT_DIR_OVERRIDE |
.env’s HOST_ROOT_DIR |
Set to "faveo" for servers installed with faveo-run.sh: its .env has no HOST_ROOT_DIR (the app folder is always ./faveo). |
MYSQL_DATABASE_OVERRIDE |
.env’s MYSQL_DATABASE |
Same as above. |
MYSQL_ROOT_PASSWORD_OVERRIDE |
.env’s MYSQL_ROOT_PASSWORD |
Same as above, or the root password was rotated in MySQL but not in .env. |
MYSQL_CONTAINER |
"<DOMAINNAME>-mysql" |
Only if the client’s compose stack doesn’t follow the standard naming from docker-compose.yml (container_name: ${DOMAINNAME}-mysql, confirmed against faveo-helpdesk-docker-v2/docker-compose.yml). Normally leave blank. |
EXTRA_BACKUP_PATHS |
[] (only HOST_ROOT_DIR + storage/ are backed up) |
Add extra paths, relative to PROJECT_DIR, e.g. ["ssl_copy"], if a client needs more than the app code + storage folder backed up. |
If resolve_settings() can’t find a required value in either .env or its
override, the script exits with Could not resolve required setting(s) [...]
naming exactly which one is missing.
FTP_HOST, FTP_PORT, FTP_USER, FTP_PASS, REMOTE_DIR) - used only by dockerftp.py.SCP_HOST, SCP_PORT, SCP_USER, SCP_PASS, SCP_REMOTE_DIR) - used only by dockerscp.py.SMB_SERVER, SMB_SHARE, SMB_USER, SMB_PASS, SMB_REMOTE_DIR) - used only by dockersmb.py.cron.sh writes one crontab line pointing at whichever docker*.py script
was chosen (dockerlocal.py / dockerftp.py / dockerscp.py /
dockersmb.py), including SMB - it is scheduled the same way as FTP/SCP, not
left out of automation. Re-running cron.sh and choosing “remove” strips any
existing line referencing those four filenames before optionally adding a new
one.
gunzip -c <db-file>.sql.gz | docker exec -i -e MYSQL_PWD='<password>' <mysql-container> mysql -u root <database>
(pass the password through MYSQL_PWD, not -p<password>: -p breaks on passwords containing shell characters such as $ or ")*-filesystem-*.tar.gz back into
PROJECT_DIR (it contains HOST_ROOT_DIR and storage/ as top-level
entries, matching the bind-mount layout in docker-compose.yml).config.py not found - config.py ships in this folder by default, next to docker_backup_common.py. If this fires, the file was moved/renamed/deleted - restore it.Could not resolve required setting(s) [...] from <PROJECT_DIR>/.env - PROJECT_DIR doesn’t point at the client’s actual checkout, or that project’s .env isn’t filled in. Verify the path and that .env has DOMAINNAME, MYSQL_DATABASE, MYSQL_ROOT_PASSWORD set. If only HOST_ROOT_DIR is missing (normal for faveo-run.sh installs), set HOST_ROOT_DIR_OVERRIDE = "faveo".docker ps; if it doesn’t match <DOMAINNAME>-mysql, set MYSQL_CONTAINER in config.py.PROJECT_DIR and BACKUP_DIRECTORY in that client’s config.py are the only things that need to change.