Skip to content

About

Free automated database backup module for Odoo 19.0 with local & SFTP storage, retention policies, scheduling, and email notifications.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

33 Commits

Folders and files

Repository files navigation

Database Ultimate Backup Lite for Odoo 20.0

License: MIT Odoo Version Price

A free, reliable database backup solution for Odoo 20.0 with local and SFTP remote storage, automated scheduling, retention policies, and comprehensive monitoring.

Features

Core Capabilities

  • Local Storage: Store backups on local filesystem or network-mounted drives
  • SFTP Remote Storage: Securely transfer backups to remote servers via SSH/SFTP
  • Backup Formats: ZIP archives with or without filestore, or PostgreSQL dumps
  • Integrity Verification: ZIP CRC checks, nonempty SQL validation, complete PostgreSQL archive parsing, and a recorded SHA-256 checksum
  • Flexible Scheduling: Manual and scheduled requests are queued for a dedicated backup worker

Advanced Management

  • Retention Policies: Keep last N backups or retain for N days
  • Automated Cleanup: Automatic removal of old backups based on retention policy
  • Job Monitoring: Track backup history, status, duration, and file sizes
  • Email Notifications: Get notified on backup success/failure
  • Success Rate Tracking: Monitor backup reliability over time

Local Storage Provider

  • Store backups on local filesystem or network-mounted drives
  • Disk space checking and monitoring
  • Integrity verification
  • Organized directory structure with date-based folders

SFTP Storage Provider

  • High-performance transfers powered by AsyncSSH
  • Password-based authentication
  • Automatic remote directory creation
  • Upload verification (file size check)
  • Configurable connection and transfer timeouts
  • Remote disk space monitoring

Security

  • Two-tier access control (User and Administrator)
  • Granular model-level permissions
  • System user for automated operations
  • Administrator-only access to SFTP passwords and transfer operations
  • Local paths confined to the configured storage directory; verified uploads are published atomically with private file permissions

Credentials are protected by Odoo access permissions; the module does not encrypt them in the database. ZIP/dump validation and checksums detect archive problems but do not replace a restore test. SFTP upload verification compares file sizes.

Installation

1. Install Dependencies

The list ships inside the module folder, as database_ultimate_backup_lite/requirements.txt, so it is also included in the module download. Install it with the same Python (or virtual environment) that runs Odoo:

pip install -r /path/to/addons/database_ultimate_backup_lite/requirements.txt

On Odoo.sh, requirements files inside module folders are not read: copy the lines of database_ultimate_backup_lite/requirements.txt into the requirements.txt of the folder that contains the module (usually the repository root).

The manifest's external_dependencies declare the minimum AsyncSSH version, so Odoo refuses to install or upgrade the module while it is missing or too old. Checking that version requires the packaging library, which is included in the requirements file.

2. Install the Module

  1. Copy the database_ultimate_backup_lite folder to your Odoo addons directory
  2. Update the apps list: Go to Apps > Update Apps List
  3. Search for "Database Ultimate Backup Lite"
  4. Click Install

3. Configure Permissions

Assign users to backup groups:

  • Settings > Users & Companies > Users
  • Select a user and go to the "Database Backup" tab
  • Assign appropriate group:
    • User: View backup configurations and jobs (read-only access)
    • Administrator: Full access to create, modify, and execute backups

Quick Start Guide

Step 1: Configure a Storage Provider

Option A: Local Storage

Navigate to Database Ultimate Backup Lite > Storage Providers > Local Storage and create a provider:

Name: Local Backup Server
Backup Directory: /opt/odoo/backups
Check Disk Space: Yes (recommended)
Min Free Space: 5 GB

Option B: SFTP Remote Storage

Navigate to Database Ultimate Backup Lite > Storage Providers > SFTP Storage and create a provider:

Name: Remote Backup Server
Hostname: backup.example.com
Port: 22
Username: backup_user
Password: ********
Remote Directory: /home/backups/odoo
Create Remote Directories: Yes

Use the Test Connection button to verify the provider is configured correctly.

Step 2: Create a Backup Configuration

Navigate to Database Ultimate Backup Lite > Backup Configurations > Create

Name: Daily Production Backup
Database: [automatically populated with current database]
Backup Format: ZIP Archive
Include Filestore: Yes

Storage Providers:
- Select your local and/or SFTP storage providers

Retention Policy: Keep Last N Backups
Number of Backups to Keep: 7

Options:
- Verify Backup Integrity: Yes
- Notify on Failure: Yes

Notification Emails: [email protected]

Click Save.

Step 3: Test Your Configuration

  1. Click the Test Providers button to verify all providers are accessible
  2. Click Create Backup Now to queue a manual test backup
  3. Open Backup Jobs and refresh to see the completed result, logs and SHA-256 checksum
  4. Verify the backup file exists in your storage location

The Database Ultimate Backup Lite Job Queue scheduled action is enabled on installation and processes pending jobs every minute. Odoo cron workers must be running. Uploads remain sequential. Repeated requests for the same configuration are rejected while a job is pending or running; Retry Backup creates a new job and preserves the previous attempt.

Step 4: Enable Automated Backups

The scheduler has a daily interval and is disabled initially. Activate it when your configuration is ready.

To customize the schedule:

  1. Go to Settings > Technical > Automation > Scheduled Actions
  2. Search for "Database Ultimate Backup Lite Scheduler"
  3. Edit the Execute Every field to your preferred interval
  4. Set the Next Execution Date if needed
  5. Enable the scheduled action

Active backup configurations will automatically run according to the cron schedule.

Configuration Reference

Backup Formats

Format Description Use Case
ZIP Archive + filestore Complete backup including database and attachments Full system backups, recommended for production
ZIP Archive without filestore Database backup packaged as a ZIP without attachments Smaller ZIP backups when attachments are backed up separately
PostgreSQL Dump PostgreSQL custom-format dump, no filestore Database-only backup restored with pg_restore

Odoo 20's database manager accepts ZIP backups. Restore a .dump file into an empty database with pg_restore --no-owner --dbname=restored_db backup.dump. Custom dumps contain no filestore, so restore matching file-backed attachments separately if needed.

Retention Policies

Policy Description Example
Keep Last N Backups Maintains the most recent N backups Keep last 7 backups = 1 week of daily backups
Keep for N Days Retains recent backups and always preserves the newest known copy Keep 30 days, plus the latest copy if all are older
Keep All Backups Disables automatic deletion for this configuration Archive without automatic retention

Retention only deletes successful uploads recorded for the current configuration and destination. Untracked files, unknown dates and ambiguous legacy locations are preserved. Keep the job history: deleting it also removes the evidence used to identify owned copies. Cleanup runs after successful or partially successful backups and through the cleanup scheduled action.

Backup Name Template

Customize backup filenames using variables:

  • {database} - Database name
  • {timestamp} - Timestamp including microseconds
  • {format} - File extension (zip or dump)

Default: {database}_{timestamp}.{format}

A unique suffix is always appended to prevent a repeated filename template from overwriting an earlier run. Partial uploads remain Warning and use the failure email preference, even when success emails are disabled.

Odoo Configuration for Large Databases

Backups, manual ones included, run in Odoo's cron worker, which is bound by limit_time_real_cron; when that option is not set, Odoo applies limit_time_real (120 seconds by default). On large databases the worker is killed before the dump or upload finishes. Adjust odoo.conf and restart Odoo; these values suit a 20-50 GB backup:

limit_time_cpu = 5400
limit_time_real_cron = 10800
limit_memory_soft = 2147483648
limit_memory_hard = 2684354560
  • Time: aim for 2-3 times the duration your backup jobs actually take (see the job's Duration).
  • Memory: keep both memory limits at least at Odoo's defaults (2 GB soft, 2.5 GB hard). They limit virtual memory per worker, not physical RAM; lower values can make backups fail with "Cannot allocate memory".
  • Comments: odoo.conf only accepts comments on their own line (starting with ; or #). A line such as limit_memory_hard = 2684354560 ; 2.5 GB keeps the comment as part of the value and Odoo fails to start.

Troubleshooting

Common Issues

"No storage providers configured"

  • Configure at least one storage provider (Local or SFTP) before creating backups
  • Ensure the provider is set to Active

"Backup failed: disk space"

  • Check available disk space on backup destinations
  • Reduce retention count or days
  • Run cleanup manually to free space

"AsyncSSH library not found"

  • Install the requirements: pip install -r /path/to/addons/database_ultimate_backup_lite/requirements.txt
  • Restart the Odoo service after installation

"Cannot allocate memory" or the backup stops after a few minutes

"SFTP connection failed"

  • Verify hostname, port, username, and password
  • Ensure the SFTP server is reachable from the Odoo server
  • Check firewall rules for SSH port (default: 22)
  • Use the Test Connection button to diagnose issues

"Scheduled backups not running"

  • Verify the cron job is active: Settings > Technical > Scheduled Actions
  • Check backup configuration is marked as Active
  • Review system logs for cron execution errors

Need Multi-Cloud Storage?

Upgrade to Database Ultimate Backup (Full Edition) for enterprise-grade multi-cloud support:

  • AWS S3 - Storage classes, encryption, versioning
  • Azure Blob Storage - Storage tiers, geo-redundancy
  • Google Cloud Storage - Flexible classes, KMS encryption
  • DigitalOcean Spaces - Cost-effective cloud storage
  • Parallel Uploads - Upload to multiple providers simultaneously
  • Server-side Encryption - AES256 and KMS encryption

Support

License

This module is licensed under the MIT License. See LICENSE file for details.

Credits

Author

  • René Hechavarría

Built With

  • Odoo 20.0 Community/Enterprise Framework
  • AsyncSSH for high-performance SFTP transfers
  • Strategy design pattern for extensibility

Database Ultimate Backup Lite - Free local & SFTP backup solution for Odoo 20.0

About

Free automated database backup module for Odoo 19.0 with local & SFTP storage, retention policies, scheduling, and email notifications.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages