Backup & Restore¶
Backup Format¶
Generated backups are Odoo.com-compatible ZIPs:
backup_2026-05-30_12-00-00.zip
├── manifest.json # Metadata (version, db_name, modules)
├── dump.sql # Full database dump (pg_dump)
└── filestore/ # Attachment filestore (tar.gz)
└── <hex_dir_structure>
Creating Backups¶
# Create a backup of the 'odoo' database in the 'main' environment
of env backup new main odoo
# Output: Backup myclient_odoo_2026-06-30_12-00-00.zip created successfully!
Backups are stored in {project}/{environment}/backups/.
Listing Backups¶
Displays a table with filename, size, age, and database name.
Restoring Backups¶
# Restore a backup to the same environment
of env restore main /path/to/backup.zip
# Restore to a specific database
of env restore main /path/to/backup.zip --db mydatabase
# Automated restore (skip confirmation)
of env restore main /path/to/backup.zip --yes
Managing Backups¶
# Delete a specific backup
of env backup rm main backup_2026-06-30_12-00-00.zip
# Prune old backups (keep the 10 most recent)
of env backup prune main --keep 10
# Delete backups older than 30 days
of env backup prune main --days 30
# Delete backups before a specific date
of env backup prune main --before 2026-06-01
Automation¶
# Daily backup via cron
0 2 * * * cd /home/user/ofprojects/myclient && of env backup new main odoo --json >> /var/log/odoofly-backup.log 2>&1
# Weekly prune (keep last 7 daily backups)
0 3 * * 0 cd /home/user/ofprojects/myclient && of env backup prune main --keep 7 --json >> /var/log/odoofly-backup.log 2>&1