Automatic Database Backup To Local Server, Remote Server,Google Drive, Dropbox, Onedrive, Nextcloud and Amazon S3 Odoo18
by Cybrosys Techno Solutions https://www.cybrosys.comAvailability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 1495 |
Technical Name |
auto_database_backup |
License | LGPL-3 |
Website | https://www.cybrosys.com |
Versions | 12.0 13.0 14.0 15.0 16.0 17.0 18.0 |
This Module Helps To Generate Automated Backup Of Databases.
Automatic Database Backup

This module uses some external python dependencies : dropbox, pyncclient , nextcloud-api-wrapper , boto3 and paramiko. Before installing the module install the python package first. The required python packages can be installed using the following commands.
pip
install dropbox
pip
install pyncclient
pip
install nextcloud-api-wrapper
pip
install boto3
pip
install paramiko
Key Highlights
Automated Backup
Generate Database Backups on regular intervals.
Remove Redundancy
Automatically remove old backups that consumes storage space.
Notification
Notify user on success and failure of backup generation.
Flexibility of Backup
Store to Remote Servers, Nextcloud, Amazon S3, Google Drive, Dropbox, Onedrive.
Multi-Level Backup Storage
Store backups in multiple locations based on different intervals.
Are you ready to make your business more
organized?
Improve now!

Database Backup Configuration Menu
Go to Setting --> Technical --> Backup Configuration to configure backups.

Create New Database Backup Configuration.
Enter the Database Name and Master Password. Specify Backup Destination. Enter the backup directory path, if directory does not exist new directory will be created.

Backup Frequency
Specify Backup Destination and Frequency. Choose how often the backup should run: daily, weekly, or monthly.

Store Backup to Remote SFTP Server.
Select Backup Destination as SFTP, enter credentials. "TEST CONNECTION" button to check whether the connection is successful.

Store Backup to Remote FTP Server.
Select Backup Destination as FTP, enter credentials. "TEST CONNECTION" button to check whether the connection is successful.

Store Backup to Google Drive
You'll need to create a new Google API project from Google Cloud console and enabling the Google Drive API, Go to the Google API Console and log into your account. While creating the project, for the Redirect URI restrictions, copy your Odoo database URI followed by /google_drive/authentication. Example:

Enable API and Services

Enable Google Drive API

Create Credentials, Follow the steps, select Website application for the Application Type.

Under the Authorized JavaScript Origins section, click + Add URI and type your company's Odoo URL address. Under the Authorized redirect URIs section, click + Add URI and type your company's Odoo URL address followed by /google_drive/authentication. After all the steps are completed, A Client ID and Client secret will be given, copy the credentials

Configure Backup, Copy Client ID and Client Secret from Google Drive API Credentials page into their respective fields. Setup Token will redirect to an authorization page.

Grant Access

Reset the token if required by clicking on the "Reset Token"

Store Backup to Dropbox.
To get the app key and secret key go to the App Console . Create a new app

Once you created the App , you can get the App key and App Secret as seen in the screenshot.

Choose your app's permission (files.content.write and files.content.read permissions required).then click on Submit

Choose Dropbox as that of the backup destination. Enter the app secret and key and dropbox Folder. Click on the Setup Token

Get the Authorization Code and click confirm.

Reset the refresh token if required by clicking on the "Reset Token"

Store Backup to Onedrive.
Select Backup Destination as OneDrive. Enter the App key and App secret. you'll need to register a new app in the Microsoft Azure portal. While registering the app for the Redirect URI restrictions, copy your Odoo database URI followed by /onedrive/authentication. Example:

Copy the Client ID and Generate Client Secret.


Add Scope in the Expose an API page.

Get OneDrive folder ID, where need to store the backup files.

Configure the Backup.

Setup Token, it will be redirected to an authorization page.

Store Backup to NextCloud.
To Create an account in Nextcloud go to https://nextcloud.com/sign-up/, Enter Your Email Address and Sign up .

You will be redirected to the page as shown in the screenshot, and it will ask you enter your email and password for the Nextcloud.

To get the Domain of the Nextcloud.Go to Settings in the Nextcloud and Click on Mobile & desktop. You will see server address Copy link and paste it in your Domain Name.

Select the backup destination as Nextcloud. Enter the Domain Name, UserName, Password and Folder Name where you want to store your backup on the NextCloud server. Check the Connect button to check if the connection is successful.

Every day, a Scheduled Action will take place to store a backup on the Nextcloud Server. The backup will be stored as the folder name provided in the Folder ID field in Odoo.

Store Backup to AmazonS3.
To Create an account in Amazon S3 go to https://portal.aws.amazon.com/billing/signup#/start/email, Enter Your Email Address and Sign up .

After you created the account.You need to get the Access Key and Secret Key,To get these go the account Security credentails and go the Access Keys and create new access keys from there you will get Access Key and Secret Key.



Next You need to create a Bucket Folder in the Amazon S3.To do that Go the Services in the top right and go to Storage and S3 as shown in the Screen shot.

To create Bucket folder,Click on the Create bucket Button.

On Creating a Bucket Folder,Check the rules for naming the Bucket folder,and Select the region as well.After that click on the create Bucket Button in the bottom of the page.

You will see the Bucket Folder as shown in the screenshot.

Select Backup Destination as Amazon S3. Enter the Amazon S3 Access Key,Amazon S3 Secret Key,Bucket Name->Bucket folder you have created in the Amazon S3 and the File Name->The Folder You want to store your backup in Amazon S3 Bucket Folder.Test connection button to check whether the connection is successful.

Every day, a Scheduled Action will take place to store a backup on the Amazon S3 Server. The backup will be stored as the folder name provided in the File Name field in Odoo.

Automatically Remove Old Backups.
Enable auto remove option, specify number of days to remove backups.

Notify User on Success and Failure of Backup Generation.
Enable notify user option, and select a user to notify. An email notification will be sent to the selected user on backup successful and failure.

Successful backup notification email.

Failed backup notification email.

Scheduled Actions For Generating Backup.
Enable the 'Automatic Database Backup' for the three scheduled actions. Based on the setup, backups will be generated at daily, weekly, and monthly intervals.


Interactive User Interface.
Store Backup To Different Locations.
Automatically Remove Old Backups.
Effortlessly manage your storage with automatic removal of old backups, freeing up space while keeping your most recent data secure.
Generate Database Backups on regular intervals.
Protect your data with our automated database backups, ensuring regular, scheduled backups for seamless recovery and integrity.
Notify User On Success And Failure Of Backup Generation.
While configuring a backup, selecting the Zip option will include the filestore in the backup, while choosing the Dump option will create a backup without the filestore.
Enable the "Remove Old Backups" option in the backup creation view to automatically delete previous backups based on the number of days specified.
Enable the "Notify User" option and specify a contact to receive an email containing a detailed report with the failure reason and backup details. This option will also send an email upon successful backup.
Select the backup destination as local storage and specify a backup path to a location on the system to create backups on your own system.
Latest Release 18.0.1.0.0
26th September, 2024- Initial Commit
Please log in to comment on this module
Report comment
Any abuse of this reporting system will be penalizedgood
excellent
Good moduel but recent issues
Hello,
The module is quite good, we have been using it for some time now.
However it seems that the python dependency "nextcloud" does not exist anymore.
When trying to install using pip install nextcloud, we get the following error:
ERROR: Could not find a version that satisfies the requirement nextcloud (from versions: none)
ERROR: No matching distribution found for nextcloud
Can you please advise, and if possible update module description for future installs?
Re: Good moduel but recent issues
Thank you for reporting the issue. I have updated the commands. Please refer to the index for installing the packages. Let me know if you need any further assistance.
External dependencies shouldn't be a thing.
I shouldn't be required to install dropbox dependencies to use this addon. I'll find a different backup solution.
Thank you for your solution
i use odoo 17 version, when i want to install, its says Unable to install module "auto_database_backup" because an external dependency is not met: Python library not installed: dropbox.
i have install using pip install dropbox on my linux ubuntu 22.04.
but its still not working, and have a same error when i want to install.
I try to restart server too, but its still doesn't fix the error
Re:
Please make sure you installed in the same python environment.
Error
While installing this module, we get the following message:
"Unable to install module "auto_database_backup" because an external dependency is not met: External dependency dropbox not installed: No package metadata was found for dropbox"
Please, either remove the dependency or add the dropbox plugin.
Thanks in advance!
Re: Error
The auto_database_backup module requires the external dependency dropbox.
To resolve this issue, you can install it by running the 'pip install dropbox' command in the terminal.
How can I enable this when Im only trying to use google drive for backup? I dont want to install dependencies I wont ever be using.
Re:
You can't do that with this app. You'll need a special app that works only with Google Drive.
You can contact us at odoo@cybrosys.com if you need more details
我安装了这个模块,配置了备份需求,但是不知道每天几点自动备份,不知道这个模块如何执行的呢
Re:
The backup runs based on a scheduled action in Odoo. You can check the execution time by going to Settings → Technical → Scheduled Actions (with developer mode enabled) and looking for 'Backup: Automatic Database Backup'. This scheduled action determines when the backup runs. If needed, you can adjust the schedule by modifying the settings of this scheduled action.
Error
I installed odoo 18 on docker in a VPS running ubuntu 24. I can't install the dependencies. dropbox error
Re: Error
Could you please provide more information? You can send an email to odoo@cybrosys.com
i download it and put it to the addons_path, but it do not appear in my app list. why? any help please
Re:
It looks like the app might be in the wrong path. Please check our blog for guidance: How to Install a Custom Module in Odoo 16.
Hi I tried this on odoo sh but it didnt work
Hi I tried this on odoo sh but it didnt work what might be the issue. I even used a public ip for ftp and sftp but neither worked
FTP errno 13
in local storage it take back up correctly
but when I use FTP I got this error
Error Message:
[Errno 13] Permission denied: 'C:\\Windows\\SERVIC~1\\LOCALS~1\\AppData\\Local\\Temp\\tmpiee23f_h.zip'
also from the server I have access to FTP but system is not take automatically
Re: FTP errno 13
This may be related to permission settings. Please ensure that the application has the necessary permissions to access the specified directory.
For detailed guidance on setting up FTP and managing permissions, see our blog, How to Setup FTP Server on Ubuntu 20.04.
Restoration Guide
The current guide focuses on generating the backup. Can you also share some screenshots / guides on the restoration procedure?
Re: Restoration Guide
It's the same as normal odoo db restoration. Nothing different.
If you need any assistance, Please email to odoo@cybrosys.com
Installed Odoo 18 on a windows machine.
How can we install the dropbox dependencies?
Re:
Example :-
"C:\Program Files\Odoo\Python\python.exe" -m pip install dropbox
"<Python Path>" -m pip show dropbox
everything is perfect but...
Greetings, in the field
Redirect URI? http://localhost:8069/google_drive/authentication
The protocol is by default in http and must be https for that reason it does not allow integration with Google
Please it would be excellent if you corrected it
Re: everything is perfect but...
The provided redirect URI is intended for testing purposes only. You can replace http://localhost:8069 with your own domain using https to ensure proper integration with Google.
Do not backup filestore ?
I choosen zip format in configuration but after unzip, i only see the dump file and manifest file, is it by this module or my odoo instance ?
Re: Do not backup filestore ?
App handles filestore properly. It may due to some configuration issue in your instance.
You can email us at odoo@cybrosy.com if you need further assistance.
S3 Compatible
Does this work with s3-compatible buckets (i.e., not from AWS)?
Re: S3 Compatible
Sorry, We haven't tested yet.