Automated backups
A tool for all your back-ups, internal and external!
Keep your Odoo data safe with this module. Take automated back-ups, remove them automatically and even write them to an external server through an encrypted tunnel. You can even specify how long local backups and external backups should be kept, automatically!
Connect with an FTP Server
Keep your data safe, through an SSH tunnel!
Want to go even further and write your backups to an external server? You can with this module! Specify the credentials to the server, specify a path and everything will be backed up automatically. This is done through an SSH (encrypted) tunnel, thanks to pysftp, so your data is safe!
Test connection
Checks your credentials in one click
Want to make sure if the connection details are correct and if Odoo can automatically write them to the remote server? Simply click on the 'Test SFTP Connection' button and you will get message telling you if everything is OK, or what is wrong!
E-mail on backup failure
Stay informed of problems, automatically!
Do you want to know if the database backup failed? Check the checkbox 'Auto. E-mail on backup fail' and fill in your e-mail. Every time a backup fails you will get an e-mail in your mailbox with technical details.
Contact / Support
Need help or want extra features?
Need help with the configuration or want this module to have more functionalities? Please create a bug report on the Github issue tracker
Please log in to comment on this module
Report comment
Any abuse of this reporting system will be penalizedWhere can see this folder: /odoo/backups?
Is it on vscode or ssh? Also, how to modify the rights of the folder? Because I also received this error:
Permission denied" while evaluating
'model.schedule_backup()'
Thank you for developing this great module and make it for free.
adding a function can directly restore the database is better
Thank you for developing a good module, adding a function can directly restore the database is better, in docker environment can also run normally
Great module!
Installed properly but i couldn,t find the base directory where backups would be hold
can anyone told me what will be the base directory this module will take. Whenever i try backup in any directories its says permission denied error
Error:
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/tools/safe_eval.py", line 354, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "/opt/odoo13/odoo-custom-addons/auto_backup/models/db_backup.py", line 124, in schedule_backup
os.makedirs(rec.folder)
File "/usr/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/odoo-custom-addons'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo13/odoo/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo13/odoo/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/opt/odoo13/odoo/odoo/http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo13/odoo/odoo/http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo13/odoo/odoo/http.py", line 915, in __call__
return self.method(*args, **kw)
File "/opt/odoo13/odoo/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1343, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1331, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo13/odoo/odoo/api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo13/odoo/odoo/api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_cron.py", line 83, in method_direct_trigger
cron.with_user(cron.user_id).with_context(lastcall=cron.lastcall).ir_actions_server_id.run()
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_actions.py", line 537, in run
res = func(action, eval_context=eval_context)
File "/opt/odoo13/odoo/addons/website/models/ir_actions.py", line 59, in run_action_code_multi
res = super(ServerAction, self).run_action_code_multi(action, eval_context)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_actions.py", line 422, in run_action_code_multi
safe_eval(action.sudo().code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to return 'action'
File "/opt/odoo13/odoo/odoo/tools/safe_eval.py", line 377, in safe_eval
pycompat.reraise(ValueError, ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr)), exc_info[2])
File "/opt/odoo13/odoo/odoo/tools/pycompat.py", line 13, in reraise
raise value.with_traceback(tb)
File "/opt/odoo13/odoo/odoo/tools/safe_eval.py", line 354, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "/opt/odoo13/odoo-custom-addons/auto_backup/models/db_backup.py", line 124, in schedule_backup
os.makedirs(rec.folder)
File "/usr/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
ValueError: <class 'PermissionError'>: "13
Permission denied" while evaluating
'model.schedule_backup()'
A big thanks to the autor of this module
since I have known this module, it is amazing. I installed it on Odoo 12 and everything works. thanks to the author. However I have a platform on odoo 12 where I have a 3 tier architecture (proxy server, app server, and separate Database server) I have some little problem, because I don't know how I should set it up. If you have a lead. Thank you in advance.
Works as advertised, but gives error.
After some tinkering she works as advertised.
However, when installed I get an error.
When uninstalled, the error disappears as well.
I'm not sure how these are related.
Odoo Server Error auto_backups
Hello, thanks first, install odoo 13 in digitalocean with your script and install the auto_backups module when executing it with the Odoobot user, the following error appears.
Error:
Odoo Server Error
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/tools/safe_eval.py", line 352, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "/odoo/custom/addons/auto_backup/models/db_backup.py", line 130, in schedule_backup
fp = open(file_path, 'wb')
PermissionError: [Errno 13] Permission denied: '/odoo/backups/2020_10_13_21_43_21_EaDonJulio.zip'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/odoo-server/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/odoo/odoo-server/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/odoo/odoo-server/odoo/http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "/odoo/odoo-server/odoo/http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/odoo/odoo-server/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/odoo/odoo-server/odoo/http.py", line 915, in __call__
return self.method(*args, **kw)
File "/odoo/odoo-server/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 1326, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 1314, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/odoo/odoo-server/odoo/addons/base/models/ir_cron.py", line 83, in method_direct_trigger
self.with_user(cron.user_id).ir_actions_server_id.run()
File "/odoo/odoo-server/odoo/addons/base/models/ir_actions.py", line 545, in run
res = func(action, eval_context=eval_context)
File "/odoo/odoo-server/addons/website/models/ir_actions.py", line 59, in run_action_code_multi
res = super(ServerAction, self).run_action_code_multi(action, eval_context)
File "/odoo/odoo-server/odoo/addons/base/models/ir_actions.py", line 430, in run_action_code_multi
safe_eval(action.sudo().code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to return 'action'
File "/odoo/odoo-server/odoo/tools/safe_eval.py", line 375, in safe_eval
pycompat.reraise(ValueError, ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr)), exc_info[2])
File "/odoo/odoo-server/odoo/tools/pycompat.py", line 13, in reraise
raise value.with_traceback(tb)
File "/odoo/odoo-server/odoo/tools/safe_eval.py", line 352, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "/odoo/custom/addons/auto_backup/models/db_backup.py", line 130, in schedule_backup
fp = open(file_path, 'wb')
ValueError: <class 'PermissionError'>: "13
Permission denied" while evaluating
'model.schedule_backup()'
Re: Odoo Server Error auto_backups
Hi,
Your folder "/odoo/backups" simply doesn't have enough access rights for your Odoo user. Modify the rights of the folder and it will work.
Related error & got fixed
https://stackoverflow.com/questions/76718424/permission-denied-while-evaluating-model-schedule-backup
The image in odoo14 cannot be installed.
The image in odoo14 cannot be installed, it is recommended to integrate it into the official Docker, or do not use the paramiko module .
root@f78b60482abf:/# pip3 install paramiko
Collecting paramiko
Downloading https://files.pythonhosted.org/packages/60/3e/84c52fb09db84548c5d366bac8863125c6db099b87495e04c8af5527e6f1/paramiko-2.9.2-py2.py3-none-any.whl (210kB)
100% |████████████████████████████████| 215kB 2.8MB/s
Collecting cryptography>=2.5 (from paramiko)
Downloading https://files.pythonhosted.org/packages/f9/4b/1cf8e281f7ae4046a59e5e39dd7471d46db9f61bb564fddbff9084c4334f/cryptography-36.0.1.tar.gz (572kB)
100% |████████████████████████████████| 573kB 1.6MB/s
Installing build dependencies ... error
Complete output from command /usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-6vjhmwmt --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.6.0 wheel "cffi>=1.12; platform_python_implementation != 'PyPy'" setuptools-rust>=0.11.4:
copying cffi/_embedding.h -> build/lib.linux-x86_64-3.7/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.7/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/c
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.7/c/_cffi_backend.o
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-evlnegz2/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-39n5_93e/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-6vjhmwmt --compile" failed with error code 1 in /tmp/pip-install-evlnegz2/cffi/
----------------------------------------
Command "/usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-6vjhmwmt --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.6.0 wheel "cffi>=1.12; platform_python_implementation != 'PyPy'" setuptools-rust>=0.11.4" failed with error code 1 in None
HI, i have a small problem. the auto back-up is working but it gives me an empty file (0kb) zip file what should i do to resolve this ?
Hi. I am trying to install Database auto-backup module by Yenthe Van Ginneken but I am getting an error. (Error: Import Error: This module needs paramiko to automatically write backups to the FTP through SFTP. Please install paramiko on your system. (sudo pip3 install paramiko)).
Even after installing the paramiko i am facing the same issue.
Hello Yenthe,
I downloaded the module and tried to install it but get the following error. I already have paramiko installed so I am not sure why I keep getting this error.
Error:
Odoo Server Error
.....
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo14/odoo/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
ImportError: This module needs paramiko to automatically write backups to the FTP through SFTP. Please install paramiko on your system. (sudo pip3 install paramiko)
It works in odoo.sh?
Does it works in odoo.sh database?
its not installing in to my odoo
Error:
Odoo Server Error
Traceback (most recent call last):
File "F:\odoo 14\server\odoo\addons\base\models\ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "F:\odoo 14\server\odoo\http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "F:\odoo 14\server\odoo\http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "F:\odoo 14\server\odoo\service\model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "F:\odoo 14\server\odoo\http.py", line 347, in checked_call
result = self.endpoint(*a, **kw)
File "F:\odoo 14\server\odoo\http.py", line 912, in __call__
return self.method(*args, **kw)
File "F:\odoo 14\server\odoo\http.py", line 531, in response_wrap
response = f(*args, **kw)
File "F:\odoo 14\server\odoo\addons\web\controllers\main.py", line 1381, in call_button
action = self._call_kw(model, method, args, kwargs)
File "F:\odoo 14\server\odoo\addons\web\controllers\main.py", line 1369, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "F:\odoo 14\server\odoo\api.py", line 396, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "F:\odoo 14\server\odoo\api.py", line 383, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-72>", line 2, in button_immediate_install
File "F:\odoo 14\server\odoo\addons\base\models\ir_module.py", line 73, in check_and_log
return method(self, *args, **kwargs)
File "F:\odoo 14\server\odoo\addons\base\models\ir_module.py", line 474, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "F:\odoo 14\server\odoo\addons\base\models\ir_module.py", line 592, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "F:\odoo 14\server\odoo\modules\registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "F:\odoo 14\server\odoo\modules\loading.py", line 455, in load_modules
loaded_modules, update_module, models_to_check)
File "F:\odoo 14\server\odoo\modules\loading.py", line 348, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "F:\odoo 14\server\odoo\modules\loading.py", line 178, in load_module_graph
load_openerp_module(package.name)
File "F:\odoo 14\server\odoo\modules\module.py", line 358, in load_openerp_module
__import__('odoo.addons.' + module_name)
File "F:\odoo 14\server\odoo\addons\auto_backup\__init__.py", line 1, in <module>
from . import models
File "F:\odoo 14\server\odoo\addons\auto_backup\models\__init__.py", line 2, in <module>
from . import db_backup
File "F:\odoo 14\server\odoo\addons\auto_backup\models\db_backup.py", line 20, in <module>
'This module needs paramiko to automatically write backups to the FTP through SFTP. '
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "F:\odoo 14\server\odoo\http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "F:\odoo 14\server\odoo\http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
ImportError: This module needs paramiko to automatically write backups to the FTP through SFTP. Please install paramiko on your system. (sudo pip3 install paramiko)
Works with Odoo.sh ?
Hello, Could you please tell me if this module works within odoo.sh ?
Regards.
ImportError: This module needs paramiko to automatically write backups to the FTP through SFTP. Please install paramiko on your system. (sudo pip3 install paramiko)
no work for me
Erreur:
Odoo Server Error
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/odoo/odoo-server/odoo/http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "/odoo/odoo-server/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/odoo/odoo-server/odoo/http.py", line 347, in checked_call
result = self.endpoint(*a, **kw)
File "/odoo/odoo-server/odoo/http.py", line 912, in __call__
return self.method(*args, **kw)
File "/odoo/odoo-server/odoo/http.py", line 531, in response_wrap
response = f(*args, **kw)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 1381, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 1369, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 396, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 383, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-72>", line 2, in button_immediate_install
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 73, in check_and_log
return method(self, *args, **kwargs)
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 474, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 592, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/odoo/odoo-server/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/odoo/modules/loading.py", line 455, in load_modules
loaded_modules, update_module, models_to_check)
File "/odoo/odoo-server/odoo/modules/loading.py", line 348, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/odoo/odoo-server/odoo/modules/loading.py", line 178, in load_module_graph
load_openerp_module(package.name)
File "/odoo/odoo-server/odoo/modules/module.py", line 358, in load_openerp_module
__import__('odoo.addons.' + module_name)
File "/odoo/odoo-server/addons/auto_backup/__init__.py", line 1, in <module>
from . import models
File "/odoo/odoo-server/addons/auto_backup/models/__init__.py", line 2, in <module>
from . import db_backup
File "/odoo/odoo-server/addons/auto_backup/models/db_backup.py", line 20, in <module>
'This module needs paramiko to automatically write backups to the FTP through SFTP. '
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/odoo-server/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
ImportError: This module needs paramiko to automatically write backups to the FTP through SFTP. Please install paramiko on your system. (sudo pip3 install paramiko)
She works amazingly after some tinkering to get her running.
However when active I get this error :
And when I remove the app the error is gone as well.
I'm not sure how this is related?
Hi Yenthe Van Ginneken.
After installing in odoo 14 then I go to Settings / Technical / Automation / Scheduled Actions. But there no any Backup action. Can you write here what parameters I must write to new Action to run backup? Thanks
get error 'Here is what we got instead: Raw'
hello,
I want to backup database to my Synology NAS.
when I click 'test sftp connections',I get these error.how can fix the error?thanks.