auto_backup is an Odoo module that allows you to automatically back up databases to a local directory or a remote server via SCP. It supports both .zip and .dump formats, scheduled backups, and retention management.
- Backup Odoo databases automatically or manually
- Save backups locally or remotely over SSH (SCP)
- Support for
.zipand PostgreSQL.dumpformats - Automatic cleanup of old backups based on retention days
- Customizable backup filenames with timestamps
- Uses
sshpassfor password-based SCP transfers if needed - Logs backup progress and errors
- Python 3.x
- Odoo installed and configured
- sshpass (for remote SCP backups with passwords)
sudo apt update
sudo apt install sshpass -y- Ensure the Odoo user has write access to the backup directory.
-
Place the module folder (
auto_backup) in your Odooaddonsdirectory. -
Update the Odoo apps list:
sudo service odoo restart
-
Go to Apps in the Odoo backend.
-
Search for Auto Backup and install the module.
To give a user access to the Auto Backup menus and features:
- Go to Settings → Users & Companies → Users.
- Open the user you want to grant access.
- In the Access Rights tab, find the Groups section.
- Assign the user to the Access group specific to Auto Backup.
- Save the user.
Once assigned, the user will see the Auto Backup menu in the Odoo backend and will be able to create or manage backup configurations according to their permissions.
-
Navigate to Settings → Auto Backup.
-
Create a new backup configuration:
- Backup Name: Custom name for your backup.
- Active: Enable or disable this backup configuration.
- SSH Login / Host / Password: Required for remote backups.
- State: Select
localorssh. - Backup Path: Local or remote path for storing backups.
- Backup Format: Choose
.zipor.dump. - Master Password: Your Odoo master password.
- Database Name: Optional; leave empty to back up the current database.
- Retention Days: Number of days to keep backups.
-
Save the configuration.
Click Backup Now on a backup configuration to trigger an immediate backup.
Use Odoo's Scheduled Actions to automatically run the scheduled_backup method at your preferred intervals.
Backups are named automatically with the pattern:
<database_name>_YYYY-MM-DD_HH-MM-SS.zip
Example:
odoo_db_2026-01-31_14-01-03.zip
- For remote backups, SSH key authentication is recommended.
- Using sshpass for password authentication is less secure, but supported.
- SCP is used to transfer backup files to remote servers.
- Temporary backup files are automatically cleaned up after SCP transfer.
- Local backups older than the retention period are deleted automatically.
Backup operations are logged using Odoo’s logger:
- Successful backups
- Failed backups
- Deleted old backups
- Errors during backup or SCP transfer
- Using passwords in plain text (sshpass) is insecure.
- Prefer SSH key authentication for remote backups.
- Ensure your backup directories are secure and have proper permissions.
MIT License – free to use and modify.