Odoo Module
Complete backup module for Odoo ERP. Backup your PostgreSQL database, filestore attachments, custom addons, and configuration.
Requirements
- Odoo 18.0 or higher
- Python 3.10 or higher
- PostgreSQL 12 or higher
- LOX API key
Installation
- Download and extract the module
Extract the module to your Odoo addons directory:
unzip lox-backup-odoo.zip -d /opt/odoo/addons/
- Update the addons path
Ensure the module directory is in your
odoo.conf:addons_path = /opt/odoo/addons,/opt/odoo/custom-addons
- Update the apps list
Go to
Apps → Update Apps Listin Odoo - Install the module
Search for "LOX Backup" in the Apps menu and click Install.
- Configure your API key
Go to
Settings → General Settingsand scroll down to the LOX Backup section, or navigate toLOX Backup → Configuration → Settings.
Configuration

LOX Backup dashboard in Odoo showing backup status and history
API Settings
| Setting | Description |
|---|---|
| API Key | Your LOX API key from backlox.com |
| API URL | Default: https://backlox.com/api (for self-hosted instances) |

LOX Backup settings page in Odoo system settings
Backup Components
| Component | Description | Default |
|---|---|---|
| Database | Full PostgreSQL dump of Odoo database | Enabled |
| Filestore | All attachments and file uploads (~/.local/share/Odoo/filestore) | Enabled |
| Custom Addons | Your custom/third-party modules | Disabled |
| Configuration | Odoo server configuration export | Enabled |
Exported Data
The module automatically exports important configuration as JSON:
- Companies - Company information and settings
- Users - User accounts and groups (passwords excluded)
- Installed Modules - List of installed addons with versions
- System Parameters - ir.config_parameter values
- Sequences - Document numbering sequences
- Mail Servers - Outgoing email server configuration
Schedule Options
- Hourly - Run backup every hour (high-traffic systems)
- Twice Daily - Run backup every 12 hours
- Daily - Run backup once per day (recommended)
- Weekly - Run backup once per week
- Disabled - Only manual backups via cron or UI
Scheduled Backups
The module uses Odoo's ir.cron system for scheduled backups. You can also trigger backups via a server cron job:
# Add to your server's crontab (runs daily at 3 AM)
0 3 * * * cd /opt/odoo && ./odoo-bin shell -d mydb -c /etc/odoo.conf --no-http <<< "env['lox.backup'].sudo().run_backup()"
# Or using curl with Odoo's JSON-RPC
0 3 * * * curl -X POST https://your-odoo.com/lox_backup/trigger \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "params": {"token": "YOUR_BACKUP_TOKEN"}}'Manual Backup
You can trigger a backup in multiple ways:
- Via UI: Go to
Settings → LOX Backup → Backup Now - Via Shell: Use the Odoo shell command
- Via API: Call the JSON-RPC endpoint
Shell Command
# Using odoo-bin shell cd /opt/odoo ./odoo-bin shell -d your_database -c /etc/odoo.conf --no-http # In the shell >>> env['lox.backup'].sudo().run_backup() >>> env.cr.commit()
Backup Structure
Each backup creates a tar.gz archive with this structure:
odoo-mycompany-20240115_030000.tar.gz
├── database.sql # Full PostgreSQL dump
├── filestore/ # Attachments and uploads
│ ├── 00/
│ ├── 01/
│ └── ...
├── addons/ # Custom addons (if enabled)
│ ├── my_custom_module/
│ └── ...
└── metadata/
├── manifest.json # Backup metadata
├── companies.json
├── users.json
├── modules.json
├── parameters.json
├── sequences.json
└── mail_servers.jsonMulti-Database Support
For Odoo installations with multiple databases, the module can be configured per-database or globally:
Per-Database Configuration
Install the module in each database and configure API keys separately. Each database will have independent backup schedules.
Global Configuration
Set lox_api_key in odoo.conf to use the same API key for all databases.
Restoring from Backup
The module provides an in-app restore wizard with text confirmation for safety:
- Navigate to backup logs
Go to Settings → LOX Backup → Backup Logs.
- Click Restore on the backup
Click the "Request Restore" button next to any completed backup.
- Confirm the restoration
Type
RESTOREin the confirmation dialog to proceed. This safety measure prevents accidental data loss.
Warning: Restore overwrites data
Restoring a backup will replace your current Odoo data with the backup contents. This action cannot be undone. Always create a fresh backup before restoring.
Manual Restore via CLI
- Download and extract the backup
Get the backup from the LOX dashboard and extract the tar.gz file.
tar -xzf odoo-mycompany-20240115_030000.tar.gz
- Restore the database
# Drop existing database (if replacing) dropdb your_database # Create new database createdb your_database # Restore from backup psql your_database < database.sql
- Restore the filestore
# Copy filestore to Odoo data directory cp -r filestore/* ~/.local/share/Odoo/filestore/your_database/ # Or for system-wide installation cp -r filestore/* /var/lib/odoo/.local/share/Odoo/filestore/your_database/
- Restore custom addons (if included)
cp -r addons/* /opt/odoo/custom-addons/
- Restart Odoo
sudo systemctl restart odoo
Odoo.sh Integration
For Odoo.sh hosted instances, you can integrate LOX Backup using a scheduled action:
Odoo.sh Note
Odoo.sh provides its own backup system. LOX Backup can be used as an additional off-site backup solution for disaster recovery or compliance requirements.
PULL Mode (New in v18.0.1.3.0)
New Feature: Server-Initiated Backups
PULL mode allows LOX to initiate backups remotely, providing centralized scheduling, better reliability, and active monitoring of your Odoo instances.
Enabling PULL Mode
- Go to LOX Backup settings
Navigate to Settings → LOX Backup → PULL Configuration.
- Enable PULL mode
Toggle "Enable PULL Backups" to generate a secure token.
- Register instance in LOX dashboard
Add your Odoo URL and PULL token in the LOX dashboard under CMS Sites.
PULL API Endpoints
POST /lox/pull/backup # Trigger backup generation GET /lox/pull/status # Get instance status and sizes GET /lox/pull/download # Download generated backup POST /lox/pull/token/refresh # Regenerate PULL token
Troubleshooting
Module not appearing in Apps
Ensure the module folder is named lox_backup (with underscore) and is in a directory listed in addons_path. Run "Update Apps List" in developer mode.
Database backup fails
The Odoo user must have permissions to run pg_dump. Verify with pg_dump --version as the Odoo user. For large databases, increase limit_time_real in odoo.conf.
Filestore backup is very large
Consider excluding large attachments by type. You can configure file exclusion patterns in the module settings (e.g., exclude .pdf files larger than 50MB).
Scheduled backups not running
Ensure Odoo's cron is running. Check that --max-cron-threads is not set to 0. View scheduled actions at Settings → Technical → Scheduled Actions.
Security Considerations
- API Key Storage: The API key is stored encrypted in the database using Odoo's
ir.config_parametersystem. - Access Control: Only users in the "LOX Backup / Administrator" group can configure settings and trigger manual backups.
- Database Passwords: User passwords are NOT included in the backup metadata. They remain only in the encrypted database dump.
- Transport Security: All data is transmitted over HTTPS with TLS 1.2+.