Automatic Database Backup To Local Server, Remote Server,Google Drive, Dropbox, Onedrive, Nextcloud and Amazon S3
by Cybrosys Techno Solutions https://www.cybrosys.comAvailability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 1478 |
Technical Name |
auto_database_backup |
License | LGPL-3 |
Website | https://www.cybrosys.com |
Versions | 12.0 14.0 13.0 15.0 16.0 17.0 |
Automatic Database Backup To Local Server, Remote Server, Google Drive, Dropbox, Onedrive, Nextcloud and Amazon S3
This Module Helps To Generate Backup Of Databases.
Explore This Module
Overview
This module uses an external python dependency 'dropbox'.Before installing the module install the python package first.The required python package can be installed using the following command,
pip install dropbox
This module uses an external python dependency 'nextcloud'.Before installing the module install the python package first.The required python package can be installed using the following command,
pip install pyncclient
This module uses an external python dependency 'nextcloud-api-wrapper'.Before installing the module install the python package first.The required python package can be installed using the following command,
pip install nextcloud-api-wrapper
This module uses an external python dependency 'Boto3'.Before installing the module install the python package first.The required python package can be installed using the following command,
pip install boto3
This module uses an external python dependency 'paramiko'.Before installing the module install the python package first.The required python package can be installed using the following command,
pip install paramiko
Features
Screenshots
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.
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 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
ENALBE 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
Go to the "OAuth consent screen", then Test users and click on 'ADD USERS' then add the user.
Configure Backup, Copy Client ID and Client Secret from Google Drive API Credentials page into their respective fields.
Setup Token, it will be redirected to an authorization page.
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
Generate Client Secret.
Get OneDrive folder ID, where need to store the backup files.
Configure the Backup
Setup Token, it will be redirected to an authorization page.
Reset the token if required by clicking on the "Reset Token"
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 Amazon S3
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
Notification email when backup generation failed
Scheduled Action For Generating Backup
Enable the 'Automatic database Backup' scheduled action, and set up the execution interval. Based on the scheduled action setup, backups will be generated on regular intervals.
Related Products
Our Services
Odoo Customization
Odoo Implementation
Odoo Support
Hire Odoo Developer
Odoo Integration
Odoo Migration
Odoo Consultancy
Odoo Implementation
Odoo Licensing Consultancy
Our Industries
Trading
Easily procure and sell your products
POS
Easy configuration and convivial experience
Education
A platform for educational management
Manufacturing
Plan, track and schedule your operations
E-commerce & Website
Mobile friendly, awe-inspiring product pages
Service Management
Keep track of services and invoice
Restaurant
Run your bar or restaurant methodically
Hotel Management
An all-inclusive hotel management application
Support
Say hi to us on WhatsApp!
+91 86068 27707
Please log in to comment on this module
Report comment
Any abuse of this reporting system will be penalizedlist_db = False does not let backups happen?
Your suggestion in my other post worked ok. Refreshing the token.
Now that odor went on production with workers and event and list_db = False suddenly backups stopped working.
I receive the following error:
odoo.service.db: Database management functions blocked, admin disabled database listing
Will you implement support for making backups on live production servers?
Thank you
Re: list_db = False does not let backups happen?
Hello, we have resolved the database listing issue. The latest version is now available for download and update.
Unable to install module "auto_database_backup" because an external dependency is not met: Python library not installed: dropbox .
I already installed the dropbox and paramiko libraries on my server and restart my server. Still have the problem.
"Acces Denied" when trying to save configuration
This module worked fine in one server but in other server it shows "Access Denied" when trying to save configuration. I have reviewed all settings and reinstalled the module and it keeps happening.
I did the google drive configuration and I get this error
Backup generation of the database gdlsyscom has been Failed.
Database Name: gdlsyscom
Destination: Google Drive
Backup Type: zip
Error Message:
'files'
Re: I did the google drive configuration and I get this error
Could you please share more details?
service log or something else.
Re: I did the google drive configuration and I get this error
Could you please share more details?
service log or something else.
Great expectations but unable to get it working with OneDrive Business as it does not have a folder id.
I have read in the comments that the team was working on fixing it at the beginning of the year, is it fixed now?
Great Module Except for 1 Bug
I love using this to backup to Google Drive. It works amazing except there's some kind of bug so it's leaving the temporary backup files on my server and not deleting them after sending the files to Google Drive so my server becomes full and I have to delete the temporary files myself. Perfect otherwise.
Re: Great Module Except for 1 Bug
We have checked for the reported issue, Once the database backup is taken to the server, it is removed from the temp directory. Could you please check the permission?
Dropbox sync error
Error Message:
'Respaldo Odoo/Odoo16-Server_2023-09-01_12-14-44.zip' did not match pattern '(/(.|[\r\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)
Re: Dropbox sync error
Make sure you have given the folder name with '/' .Eg: /Odoobackups
dropbox install problem
Unable to install module "auto_database_backup" because an external dependency is not met: Python library not installed: dropbox
Re: dropbox install problem
Explained in App index . Please have a look
not complete to get gdrive "get token" action
After allowing permissions y gdrive, i get this error.
"GET /google_drive/authentication?state={%22backup_config_id%22: 1, %22url_return%22: %22https://eym-oficinas.ovh/web%23id%3D1%26action%3D810%26view_type%3Dform%26model%3Ddb.backup.configure%22}&code=4/0Adeu5BUZb1fIYLqHZCxwUsHvAvHz0tEO09IJ70rzCKAlBkFAD2tiI73sleX2VDpPTeJZ6Q&scope=https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.file HTTP/1.1" 500 - 2 0.001 0.609
erp45 | AttributeError: 'HttpRequest' object has no attribute 'redirect' - - -
Unable to install module
Unable to install module "auto_database_backup" because an external dependency is not met: Python library not installed: dropbox
but it is already installed :
pip show dropbox
Name: dropbox
Version: 11.36.2
Summary: Official Dropbox
API Client Home-page: http://www.dropbox.com/developers
Author: Dropbox
Author-email: dev-platform@dropbox.com
License: MIT License
Location: c:\odoo\myenv\lib\site-packages Requires: requests, six, stone
Yeah worked very well.
For the 1 start above or below - need to install paramiko by activating your virtual environment and use
pip3 install paramiko
deactivate and restart odoo.service and check again. Should install and work fine. I think you could possibly adjust the 1-star rating also as that is the only issue - you did have the requirements installed.
Re: Yeah worked very well.
Thanks for your feedback
Not working
I'm getting an error when installing the module:
Re: Not working
You have to install a package called 'paramiko'
command: pip3 install paramiko
i can't download the module
Re: i can't download the module
Try after sometime
Google Drive backup not working
All configuration was done following the guide properly and refresh token was generated successfully. But google Drive backup is not working and Odoo logs don't show any errors either. any suggestions?
does it work with Onedrive for Business?
I'm using Onedrive for Business instead of Personal, there's no folder ID, the folder link is something like"https://xxx-my.sharepoint.com/:f:/g/personal/adamw_relaxltd_com_cn/EhNbuLWu1HVLmS_46YbxNekB3oNFFe6jN5ErfeXqYVtoxw?e=Bj0y4C", what should I fill?
Re: does it work with Onedrive for Business?
Currently the module, 'auto_database_backup' is not compatible with onedrive business. We are working on it
When using onedrive backup, the Redirect URI starts with http. However, Microsoft only supports https now. How can we solve this problem?
Unable to install module "auto_database_backup" because an external dependency is not met: Python library not installed: dropbox while installing on odoo.sh
Re:
You have to install the dropbox package, Please check the app index to do the same
how can i get Drive Folder ID?
Great support.
Taht was it. Thank you!
Re: Great support.
Thanks for reaching out.
Great module, works fine, until it does not!
I have the module configured for Google Drive.
It was working flawlessly for something like two weeks.
Suddenly I receive an e-mail stating that the backup failed! I go into the module configuration and revalidate the token, and that works ok but when I try to make a manual backup I receive a popup stating:
Validation Error
Please check the credentials before activation
What could be happening? Which credentials should I check? The ones at google? They have had no change. And what activation is the app talking about. The error message is a bit vague, at least for me.
Thanks for any help.
Re: Great module, works fine, until it does not!
It seems the issue might stem from an expired refresh token or an error during the creation of the backup file for upload to Google Drive. Could you try refreshing the token?
Needs a code walk around of list_db = False !
within the method:
it's not allowed to perform this action because in the configuration file, when database manager is disabled (list_db = False) then there is no db listed or allowed to be accessed.
Yenthe already did it in 2020:
Yenthe Commit on Github
You guys should try to fix this.
Thanks.
Scheduled job not working
I installed the module on 16 community, set it up with onedrive integration, the scheduled job doesn't works but if I run manually the job it works well.
How i can fix the automatic cron task?
Big DBs
The module works perfect and upload to drive if the size less than 0.5 GB
but for Large DBs (morethan 1GB) Google drive returns empty error.
Please check
on last update "next cloud_client" broke the add-on and generate general error server:
This is part of the log message
2023-10-03 23:18:51,134 432572 CRITICAL miditecsge16 odoo.modules.module: Couldn't load module auto_database_backup
2023-10-03 23:18:51,134 432572 CRITICAL miditecsge16 odoo.modules.module: No module named 'nextcloud_client'
2023-10-03 23:18:51,136 432572 WARNING miditecsge16 odoo.modules.loading: Transient module states were reset
2023-10-03 23:18:51,136 432572 ERROR miditecsge16 odoo.modules.registry: Failed to load registry
2023-10-03 23:18:51,136 432572 ERROR miditecsge16 odoo.http: Exception during request handling.
Traceback (most recent call last):
File "/odoo16/odoo16-server/odoo/modules/registry.py", line 64, in __new__
return cls.registries[db_name]
File "", line 2, in __getitem__
File "/odoo16/odoo16-server/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/odoo16/odoo16-server/odoo/tools/lru.py", line 34, in __getitem__
a = self.d[obj]
KeyError: 'miditecsge16'
Luis G
Re:
Make sure you have installed all the required Python packages.To solve the problem, try installing these packages,
pip install pyncclient
pip install nextcloud-api-wrapper
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead:
how to activate virtual environment?
Google drive .ZIP
Only dump backups are being uploaded to drive
Any idea why .zip back up not being uploaded ? tried 3 servers, less than 1 GB size.
Re: Google drive .ZIP
Please ensure that you have selected 'ZIP' as the backup format in the Backup configuration.
Error en sincronización con Dropbox
Hola, me aparece el siguiente error en el mail:
Error Message:
'Respaldo Odoo/Odoo16-Server_2023-09-01_12-14-44.zip' did not match pattern '(/(.|[\r\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)
La vinculación la estoy haciendo con Dropbox
¿Que puedo hacer?
Re: Error en sincronización con Dropbox
Make sure you have given the folder name with '/' .Eg: /Odoobackups
Error de sincronización con Dropbox
Hola, me aparece el siguiente error en el mail:
Error Message:
'Respaldo Odoo/Odoo16-Server_2023-09-01_12-14-44.zip' did not match pattern '(/(.|[\r\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)
La vinculación la estoy haciendo con Dropbox
¿Que puedo hacer?
Installation is successful.
However it gives error "Invalid Database name!" What can be the issue here since i am putting correct db name and still get error.
Re:
It can be of any reason.
Please write to odoo@cybrosys.com. Our team will get in touch with you.
RPC_ERROR
Odoo Server Error
Re:
Try to use the command pip3 install dropbox pip3 install paramiko
check the versions are Dropbox - 11.36.2paramiko - 3.2.0
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo16/odoo16/odoo/tools/safe_eval.py", line 362, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(414,)", line 1, in
File "/opt/odoo16/odoo16/odoo/addons/auto_database_backup/models/db_backup_configure.py", line 501, in _schedule_auto_backup
if rec.gdrive_token_validity fields.Datetime.now():
TypeError: '
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo16/odoo16/odoo/http.py", line 1584, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo16/odoo16/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo16/odoo16/odoo/http.py", line 1611, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo16/odoo16/odoo/http.py", line 1815, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo16/odoo16/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo16/odoo16/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo16/odoo16/odoo/addons/web/controllers/dataset.py", line 46, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo16/odoo16/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo16/odoo16/odoo/api.py", line 461, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo16/odoo16/odoo/api.py", line 448, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo16/odoo16/odoo/addons/base/models/ir_cron.py", line 86, in method_direct_trigger
cron.with_user(cron.user_id).with_context({'lastcall': cron.lastcall}).ir_actions_server_id.run()
File "/opt/odoo16/odoo16/odoo/addons/base/models/ir_actions.py", line 668, in run
res = runner(run_self, eval_context=eval_context)
File "/opt/odoo16/odoo16/odoo/addons/base/models/ir_actions.py", line 538, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self)) # nocopy allows to return 'action'
File "/opt/odoo16/odoo16/odoo/tools/safe_eval.py", line 376, in safe_eval
raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))
ValueError: : "''model._schedule_auto_backup()'
The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
at makeErrorFromResponse (https://wpcdeckingmyanmar.com/web/assets/516-c8f29b5/web.assets_backend.min.js:992:163)
at XMLHttpRequest. (https://wpcdeckingmyanmar.com/web/assets/516-c8f29b5/web.assets_backend.min.js:1000:13)
[Solved]
Unable to install module "auto_database_backup" because an external dependency is not met: Python library not installed: dropbox
[Solution]
activate odoo venv
upgrade pip "pip install --upgrade pip"
"pip install dropbox"
"pip install paramiko"
"pip list modules" to check installed libraries
Re:
Thanks for sharing here..
Re:
Try to use the commandpip3 install dropboxpip3 install paramikocheck the versions are Dropbox - 11.36.2paramiko - 3.2.0
Trying to install the app in Odoo in Windows 10
Got Error Message " Unable to install module "auto_database_backup" because an external dependency is not met: Python library not installed: dropbox"
After Install Python and Pip Install Dropbox, the message still appears. May I know what to do next?
Hi Guys,
Probably doing something wrong. I installed this module on odoo.sh. When I try to create a backup configuration, I can't save it (access Denied) I am logged in as administrator.
I took a gamble what to fill in as database name and placed a point as password. I guess this is wrong, but what to fill in here?
Any assistance would be appriciated.
Kind Regards,
Henk
Re:
Unfortunately, this app wont work in Odoo.sh
can not install
getting
Unable to install module "auto_database_backup" because an external dependency is not met: Python library not installed: dropbox
I have dropbox package installed > dropbox 11.36.0
Any idea why its failing to install
Re:
Please check you have installed dropbox in the same python environment.
If yes, Please connect with us on odoo@cybrosys.com
is it possible to use in odoo.sh (V16)as it not providing master password
Re:
No, unfortunately.
No model found on scheduled actions config
I am trying to set up the cron job for the automatic backup, but the Automatic Database Backup model does not appear in the list nor in the models' config. Is there an extra step to do?
Re: No model found on scheduled actions config
Please check whether the module is installed or not.
"Access Denied" because of list_db is set to False in configuration file
Is is possible to run this module without changing the settings of configuration to list the db because it is crucial for secure safety that not to list the databases from the frontend
Re: "Access Denied" because of list_db is set to False in configuration file
It's working fine with the list_db parameter. Can you please provide more information to reproduce the error?
"Access Denied" error
when creating the backup configuration record, it says "Access Denied"
Re: "Access Denied" error
Please explain the configurations that are done. A screenshot will be helpful.
still not able to install the module
Re:
Could you please send an email to odoo@cybrosys.com ? Our team will connect you.
Does ist backup the filestore?
Would be great to learn if the database only, or database + filestore is handled with this module.
Thank you!
Re: Does ist backup the filestore?
Both database and filestore are handled in this module
I'm using Onedrive for Business instead of Personal, there's no folder ID, the folder link is something like"https://xxx-my.sharepoint.com/:f:/g/personal/adamw_relaxltd_com_cn/EhNbuLWu1HVLmS_46YbxNekB3oNFFe6jN5ErfeXqYVtoxw?e=Bj0y4C", what should I fill?
Re:
Currently the module, 'auto_database_backup' is not compatible with onedrive business. We are working on it
Added requirement.txt in odoo.sh but still not working
Added requirement.txt in odoo.sh but still not working dropbox==11.36.0
Added requirement.txt in odoo.sh but still not working
Added requirement.txt in odoo.sh but still not working dropbox==11.36.0
Re: Added requirement.txt in odoo.sh but still not working
Are you still not able to install the module or not able to make the module work?
Error
Hello,
When you install the module and connect to google drive you wont be able to sny with google calendar
Re: Error
We cannot reproduce the issue that you described on our side.first please check your Google API configurations are correct. If the issue persists, Please contact us with the extra details of the issue that you have faced, or please provide your email address, and we will contact you.
frustated and time waste with FREE not free apps
error : Dependant DropBox missing
Re: frustated and time waste with FREE not free apps
You have to install the dropbox package, Please check the app index to do the same