odoo-backup is a stateless docker service that creates rotating backups of odoo and uploads them to any SFTP server. The image is based on python alpine and was coded to use minimal resources.
- Stateless backup service for odoo databases
- Upload backup to sftp target
- Set scheduling for backups
- Set maximum backups per day, month and year
- Set time based on your timezone
- Contributed by:
GABIT Marco Gantenbein - Docker Image:
gabitch/odoo-backup
ODOO_URL*required - URL of odoo instance. For docker in the same network the container name could be used like "http://odoo:8069"ODOO_MASTER_PWD*required - odoo master passwordODOO_DB_NAME*required - name of odoo database to back upODOO_BACKUP_FORMAT**optional - backup format zip or dump, default=zipSFTP_HOST*required - sFTP server address as domain or IPSFTP_USER*required - sFTP server userSFTP_PASSWORD*required - sFTP server passwordSFTP_PORT**optional - port of sFTP Server, default=22SFTP_PATH**optional - path on sFTP Server, default="/"TZ**optional, set timezone, default="UTC"BACKUP_TIME**optional, start time for backup or time which daily backup should be preserved, default="02:00"BACKUP_EVERY_HOUR**optional, set hours between the backups if hourly backup should be done, default=NoneHOURLY_BACKUP_KEEP**optional, set count of hourly backups to keep (total hours = BACKUP_EVERY_HOUR * HOURLY_BACKUP_KEEP), default=4DAILY_BACKUP_KEEP**optional, set count of daily backups to keep, default=30MONTHLY_BACKUP_KEEP**optional, set count of monthly backups to keep, default=12YEARLY_BACKUP_KEEP**optional, set count of yearly backups to keep (unlimited=-1), default=-1TEST_MODE**optional, set TEST_MODE=True to directly execute backup without schedulingBACKUP_CHUNK_SIZE_MB**optional, upload/download pipeline chunk size in megabytes (default=4). Tune based on network/latency; 2–8 is typical.BACKUP_QUEUE_MAX_SIZE**optional, max queued chunks between downloader and uploader (default=64). Increase to improve parallelism on high-latency links.SFTP_SSH_CIPHERS**optional, comma-separated preferred SSH ciphers (default: [email protected],[email protected],aes128-ctr)SFTP_SSH_COMPRESSION**optional, enable SSH compression true/false (default: false)SFTP_REKEY_BYTES**optional, rekey threshold in bytes (default: 17179869184 i.e. 16 GiB)SFTP_REKEY_PACKETS**optional, rekey threshold in packets (default: 4294967296)SFTP_TCP_NO_DELAY**optional, set TCP_NODELAY on SSH socket true/false (default: true)SFTP_SOCK_BUF_KB**optional, socket send/recv buffer size in KiB (default: 1024)
- Increase timeout to 14400
- Fix remove timeout for backup requests
- Add additional supported backup formats
- Replace pysftp with paramiko
- Optimize SFTPHandler
- Add additional logging
- Update to python 3.13
- Update python packages to newest versions
- Fix remove local backup in the container after upload and on start of container
- Add Multithreading support for backup durations of more than 1 hour
- Fix "No hostkey" error for reconnecting
- Fix "SSH session not active" error for huge backups. Add reconnect method with 3 retries
- Add HOURLY_BACKUP_KEEP as a new environment variable
- Add docstrings to script, class and methods
- Fix cleanup process with remaining backups
First relaese with all base functions and environment variables
None
- Add automated tests