Backup & Recovery
Backup & Recovery
Protect your institution’s data with regular backups and learn how to restore when needed.
Time Required: 15 minutes Module: Core (Database Administration) User Role: System Administrator
Table of Contents
- Backup Overview
- Creating Backups
- Automated Backups
- Restoring from Backup
- Backup Best Practices
- Troubleshooting
Backup Overview
What Gets Backed Up
| Component | Included | Description |
|---|---|---|
| Database | Yes | All records, settings, configurations |
| File Store | Yes | Uploaded documents, images, attachments |
| Custom Code | Optional | Custom modules (if applicable) |
Backup Types
| Type | Use Case | Size |
|---|---|---|
| Full Backup (with filestore) | Complete system recovery | Large |
| Database Only | Data recovery | Medium |
| Incremental | Frequent backups | Small |
Creating Backups
Method 1: Database Manager (Web Interface)
- Navigate to
/web/database/managerin your browser - Enter the master password
- Click Backup next to your database
- Select backup format:
- ZIP (with filestore) - Complete backup
- pg_dump - Database only
- Click Backup
- Download the backup file
Method 2: Command Line
For PostgreSQL database backup:
# Full database backuppg_dump -U odoo -F c -b -v -f backup_$(date +%Y%m%d).dump dbname
# With compressionpg_dump -U odoo dbname | gzip > backup_$(date +%Y%m%d).sql.gzMethod 3: Odoo CLI
# Using odoo-bin./odoo-bin -d dbname --backup /path/to/backup.zipBackup Naming Convention
Use consistent naming for easy identification:
openeducat_YYYY-MM-DD_HH-MM.zipExample: openeducat_2026-01-06_14-30.zip
Automated Backups
Setting Up Scheduled Backups
Using Cron
Create a backup script:
#!/bin/bashBACKUP_DIR="/var/backups/openeducat"DB_NAME="openeducat"DATE=$(date +%Y-%m-%d_%H-%M)
# Create backuppg_dump -U odoo -F c $DB_NAME > $BACKUP_DIR/db_$DATE.dump
# Copy filestoretar -czf $BACKUP_DIR/filestore_$DATE.tar.gz /var/lib/odoo/filestore/$DB_NAME
# Remove backups older than 30 daysfind $BACKUP_DIR -type f -mtime +30 -deleteSchedule with crontab:
# Daily backup at 2 AM0 2 * * * /path/to/backup_script.shBackup Retention Policy
| Backup Type | Frequency | Retention |
|---|---|---|
| Daily | Every day | 7 days |
| Weekly | Every Sunday | 4 weeks |
| Monthly | 1st of month | 12 months |
| Yearly | January 1st | 5 years |
Cloud Backup Options
| Provider | Integration |
|---|---|
| AWS S3 | s3cmd, aws-cli |
| Google Cloud | gsutil |
| Azure Blob | azcopy |
| Dropbox | rclone |
Restoring from Backup
Method 1: Database Manager (Web Interface)
- Navigate to
/web/database/manager - Enter the master password
- Click Restore Database
- Fill in the form:
| Field | Description |
|---|---|
| Master Password | Database master password |
| File | Upload backup ZIP file |
| Database Name | Name for restored database |
| Neutralize | Check to disable external integrations |
- Click Restore
Method 2: Command Line
For PostgreSQL restore:
# Stop Odoo service firstsudo systemctl stop odoo
# Restore databasepg_restore -U odoo -d dbname -v backup.dump
# Or for SQL backupspsql -U odoo dbname < backup.sql
# Restore filestoretar -xzf filestore_backup.tar.gz -C /var/lib/odoo/filestore/
# Start Odoo servicesudo systemctl start odooPost-Restore Steps
- Verify data integrity - Check key records exist
- Test login - Ensure user accounts work
- Check attachments - Verify uploaded files are accessible
- Review scheduled actions - Disable if running in test environment
- Update external integrations - If restored to different server
Backup Best Practices
Storage Guidelines
| Recommendation | Details |
|---|---|
| Multiple locations | Store backups on different servers/cloud |
| Encryption | Encrypt sensitive backup files |
| Access control | Restrict who can access backups |
| Regular testing | Verify backups can be restored monthly |
Pre-Backup Checklist
- Sufficient disk space available
- Database not in heavy use (if possible)
- Previous backup completed successfully
- Backup location accessible
Security Considerations
| Practice | Implementation |
|---|---|
| Encrypt backups | Use GPG or similar encryption |
| Secure transfer | Use SFTP/SCP for remote copies |
| Access logging | Track who accesses backup files |
| Separate credentials | Use different passwords for backups |
Disaster Recovery Plan
- Document procedures - Written recovery steps
- Assign responsibilities - Who handles recovery
- Test quarterly - Perform full recovery test
- Update contacts - Emergency contact list
- Review regularly - Update plan as systems change
Troubleshooting
Backup fails to complete
Possible causes:
- Insufficient disk space
- Database connection issues
- Permission problems
Solutions:
- Check available disk space:
df -h - Verify database credentials
- Check file permissions on backup directory
Restore fails with error
Common errors:
| Error | Solution |
|---|---|
| ”Database exists” | Drop existing database or use new name |
| ”Permission denied” | Check PostgreSQL user permissions |
| ”Invalid backup format” | Verify backup file is not corrupted |
| ”Version mismatch” | Ensure PostgreSQL versions match |
Filestore not restored
Symptoms: Database works but images/attachments missing
Solution:
- Verify filestore was included in backup
- Check filestore path configuration
- Restore filestore separately if needed
- Verify file permissions (odoo user must own files)
Large backup performance
For large databases:
- Use parallel dump:
pg_dump -j 4(4 parallel jobs) - Compress during backup
- Schedule during low-usage hours
- Consider incremental backups
Related Topics
Last updated: January 2026