Automatic Database Backup To Local Server, Remote ServerGoogle Drive, Dropbox, Onedrive, Nextcloud and Amazon S3 Odoo19
by Ahmed Elkeshawy$ 115.61
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 1781 |
| Technical Name |
apex_auto_database_backup |
| License | OPL-1 |
| Versions | 17.0 18.0 19.0 |
Advanced Database Backup Module
Complete Configuration Guide for All Backup Methods
📋 Module Overview
The Advanced Database Backup Module provides comprehensive backup solutions for Odoo databases with support for multiple storage destinations, automated scheduling, and secure credential management.
🔄 Automated Backups
Schedule automatic database backups with configurable retention policies and multiple format options.
☁️ Multi-Destination
Backup to local storage, cloud services (Google Drive, OneDrive, Dropbox, Amazon S3), or remote servers (FTP, SFTP, NextCloud).
🔐 Secure & Reliable
OAuth2 authentication, encrypted credentials, and comprehensive error handling with retry mechanisms.
🚀 Quick Start Guide
Install the Module
Install through Odoo Apps marketplace and navigate to Settings → Database Backup → Backup Configurations.
Create Backup Configuration
Click "Create" and fill in the basic information:
- Name: Descriptive name for your backup configuration
- Database Name: The Odoo database to backup
- Master Password: Odoo master password for database access
- Backup Format: ZIP (recommended) or Dump format
Select Backup Destination
Choose your preferred backup destination from the available options and follow the specific configuration guide for that method.
Configure Additional Settings
- Auto Remove: Enable automatic deletion of old backups
- Days to Remove: Set retention period (e.g., 30, 60, 90 days)
- Notify User: Enable email notifications for backup status
- User: Select user to receive notifications
Test and Activate
Test the connection to your backup destination and activate the configuration. The system will automatically schedule backups based on your settings.
💾 Local Storage Backup
Backup your database to a local directory on the Odoo server.
Select Backup Destination
Choose "Local Storage" from the Backup Destination dropdown.
Configure Backup Path
Specify the local directory path where backups will be stored:
- Linux Example:
/opt/odoo/backups/ - Windows Example:
C:\Odoo\Backups\
Set Directory Permissions
Ensure the Odoo user has write permissions to the backup directory:
Configure Retention Policy
Enable "Auto Remove" and set "Days to Remove" to automatically delete old backups.
⚙️ Technical Details
- Backups are stored as compressed ZIP files containing database dump, filestore, and manifest
- Automatic cleanup removes files older than specified days
- No external dependencies required
- Fastest backup method with no network latency
🌐 FTP Server Backup
Backup your database to a remote FTP server.
Select Backup Destination
Choose "FTP" from the Backup Destination dropdown.
Configure FTP Connection
Fill in the FTP server details:
| Field | Description | Example |
|---|---|---|
| FTP Host | FTP server address | ftp.example.com |
| FTP Port | FTP server port (usually 21) | 21 |
| FTP User | FTP username | odoo_backup |
| FTP Password | FTP password | ******** |
| FTP Path | Target directory on FTP server | /backups/odoo/ |
Test Connection
Click "Test Connection" to validate the FTP credentials and server accessibility.
Security Considerations
- Use FTPS (FTP over SSL) if available for secure transmission
- Configure firewall rules to allow FTP connections
- Ensure backup files are not publicly accessible on the FTP server
🔐 SFTP Server Backup
Backup your database to a remote SFTP server using SSH.
Select Backup Destination
Choose "SFTP" from the Backup Destination dropdown.
Configure SFTP Connection
Fill in the SFTP server details:
| Field | Description | Example |
|---|---|---|
| SFTP Host | SFTP server hostname or IP | sftp.example.com |
| SFTP Port | SFTP server port (usually 22) | 22 |
| SFTP User | SSH username | odoo_user |
| SFTP Password | SSH password | ******** |
| SFTP Path | Target directory on SFTP server | /home/odoo_user/backups/ |
Test Connection
Click "Test Connection" to validate the SFTP credentials and server accessibility.
Advanced Options
For enhanced security, consider using SSH key-based authentication:
📊 Google Drive Backup
Backup your database to Google Drive using OAuth2 authentication.
Google Cloud Platform Setup
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to "APIs & Services" → "Library"
- Enable "Google Drive API"
- Go to "Credentials" and create OAuth 2.0 Client ID
- Set application type to "Web application"
- Add authorized redirect URI:
https://your-odoo-domain.com/google_drive/authentication
- Copy the Client ID and Client Secret
Odoo Configuration
- Select "Google Drive" as Backup Destination
- Enter the Client ID and Client Secret from Google Cloud Console
- Note the auto-generated Redirect URI (should match the one in GCP)
- Click "Setup Token" to initiate OAuth2 flow
- You'll be redirected to Google authentication
- Grant permissions to the application
- You'll be redirected back to Odoo automatically
Configure Google Drive Folder
Specify the target folder in Google Drive:
- Folder ID: The unique identifier for the Google Drive folder
- To find Folder ID: Open the folder in Google Drive, the URL contains the ID
https://drive.google.com/drive/folders/FOLDER_ID_HERE
Token Management
- Access tokens automatically refresh when expired
- Manual token reset available via "Reset Token" button
- Token validity displayed for reference
📦 Dropbox Backup
Backup your database to Dropbox using OAuth2 authentication.
Dropbox App Configuration
- Go to Dropbox Developer Portal
- Click "Create app"
- Choose:
- API: Scoped access
- Type: Full Dropbox
- Name: Your app name (e.g., "Odoo Backup")
- In app settings, note the App key and App secret
- Under "Permissions", ensure files content access is enabled
Odoo Configuration
- Select "Dropbox" as Backup Destination
- Enter the App Key and App Secret from Dropbox
- Click "Setup Token"
- A wizard opens with Dropbox authorization URL
- Click "Get Authorization Code" link
- Authorize your Dropbox account
- Copy the authorization code
- Paste the code in the wizard and confirm
Configure Dropbox Folder
Specify the target folder path in Dropbox:
- Dropbox Folder: Path where backups will be stored
- Example:
/OdooBackups - Folder will be created automatically if it doesn't exist
Advanced Features
- Chunked upload for large backup files
- Automatic retry mechanism for network issues
- Resumable upload sessions for interrupted transfers
🗂️ OneDrive Backup
Backup your database to Microsoft OneDrive using OAuth2 authentication.
Azure App Registration
- Go to Azure Portal
- Navigate to "Azure Active Directory" → "App registrations"
- Click "New registration"
- Set application name and redirect URI:
https://your-odoo-domain.com/onedrive/authentication
- After creation, note the Application (client) ID
- Generate a Client secret in "Certificates & secrets"
Configure API Permissions
- Go to "API permissions" → "Add a permission"
- Choose "Microsoft Graph" → "Delegated permissions"
- Add the following permissions:
Files.ReadWrite.Alloffline_accessopenid
- Click "Grant admin consent" for the permissions
Odoo Configuration
- Select "OneDrive" as Backup Destination
- Enter the Client ID and Client Secret from Azure
- Note the auto-generated Redirect URI
- Click "Setup Token" to initiate OAuth2 flow
- You'll be redirected to Microsoft authentication
- Login and grant permissions
- Automatic redirect back to Odoo
Configure OneDrive Folder
Specify the target folder in OneDrive:
- Folder ID: Unique identifier for the OneDrive folder
- To find Folder ID: Browse to the folder in OneDrive web
URL format: https://onedrive.live.com/?id=ROOT&cid=FOLDER_ID
☁️ NextCloud Backup
Backup your database to a NextCloud instance using WebDAV protocol.
Prerequisites
- NextCloud instance with WebDAV enabled
- User account with appropriate permissions
- Network accessibility from Odoo server
NextCloud Configuration
Fill in the NextCloud connection details:
| Field | Description | Example |
|---|---|---|
| Domain Name | Your NextCloud instance URL | https://nextcloud.example.com |
| User Name | NextCloud username | odoo_user |
| Password | NextCloud password | ******** |
| Folder ID | Target folder name in NextCloud | OdooBackups |
Test Connection
Click "Test Connection" to validate NextCloud credentials and accessibility.
Security Considerations
- Ensure WebDAV access is enabled on NextCloud
- Consider using app-specific passwords for enhanced security
- Verify folder permissions in NextCloud
- Use HTTPS for secure communication
📊 Amazon S3 Backup
Backup your database to Amazon S3 cloud storage.
AWS S3 Configuration
- Go to AWS S3 Console
- Create a new S3 bucket with unique name
- Choose region close to your users for better performance
- Note the bucket name for Odoo configuration
IAM User Creation
- Go to AWS IAM Console → Users → Add user
- Set username and choose "Programmatic access"
- Attach existing policies:
AmazonS3FullAccess(or create custom policy) - Save the Access Key ID and Secret Access Key
Odoo Configuration
Fill in the AWS S3 details:
| Field | Description | Example |
|---|---|---|
| Amazon S3 Access Key | IAM user Access Key ID | AKIAIOSFODNN7EXAMPLE |
| Amazon S3 Secret Key | IAM user Secret Access Key | wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY |
| Bucket Name | Your S3 bucket name | odoo-backup-bucket |
| File Name | Folder path within bucket | backups/ |
Test Connection
Click "Test Connection" to validate AWS credentials and bucket accessibility.
Cost Optimization
- Configure S3 lifecycle rules for automatic archival
- Consider using S3 Intelligent-Tiering for cost savings
- Set up cost allocation tags for monitoring
- Enable S3 storage analytics for usage insights
⚙️ Advanced Configuration
🔧 Backup Schedule Management
Configure when and how often backups are executed:
Cron Job Configuration
The module uses Odoo's built-in cron scheduler. To modify the schedule:
- Go to Settings → Technical → Scheduled Actions
- Find "Backup : Automatic Database Backup"
- Edit the execution parameters:
- Interval Number: Frequency value (e.g., 1)
- Interval Type: days, hours, minutes
- Next Execution: When to run next
- Number of Calls: -1 for unlimited
Recommended Schedule
- Production: Daily during low-usage hours (e.g., 2:00 AM)
- Development: Weekly or before major updates
- Testing: Manual triggers as needed
📧 Email Notifications
Configure backup status notifications:
Enable Notifications
- Check "Notify User" in backup configuration
- Select the user to receive notifications
- Customize email templates if needed
Notification Types
- Success: Sent when backup completes successfully
- Failure: Sent when backup encounters errors
- Both include detailed information about the backup operation
🛡️ Security Best Practices
🔑 Credential Management
- Use application-specific passwords for cloud services
- Regularly rotate access tokens and API keys
- Never store credentials in version control
🌐 Network Security
- Implement firewall rules for FTP/SFTP connections
- Use VPN for remote server access when possible
- Enable SSL/TLS for all external connections
📊 Monitoring & Auditing
- Monitor backup logs for unauthorized access attempts
- Set up alerting for failed backup operations
- Regularly test backup restoration procedures
🚨 Troubleshooting Common Issues
Permission Errors
- Check file/directory permissions for local backups
- Verify IAM policies for S3 access
- Confirm OAuth scopes for cloud services
Network Issues
- Check firewall rules and network connectivity
- Verify DNS resolution for remote hosts
- Test network bandwidth for large backups
Authentication Problems
- Re-generate OAuth tokens if expired
- Check token expiration dates
- Verify redirect URIs match exactly
Storage Space
- Monitor available disk space for local backups
- Set appropriate retention policies
- Consider compression for large databases
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module