Skip to content

Commit 2b7c61a

Browse files
committed
Merge PR #3180 into 17.0
Signed-off-by pedrobaeza
2 parents b3f49b2 + 72121cc commit 2b7c61a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+35767
-0
lines changed

auto_backup/README.rst

+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
====================
2+
Database Auto-Backup
3+
====================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:163fe86803c25bd1647c8a149b89b15db756b9f3551c73e29bc93c5d1d31a2ee
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
20+
:target: https://github.com/OCA/server-tools/tree/17.0/auto_backup
21+
:alt: OCA/server-tools
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-auto_backup
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=17.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
A tool for all your back-ups, internal and external!
32+
33+
**Table of contents**
34+
35+
.. contents::
36+
:local:
37+
38+
Installation
39+
============
40+
41+
Before installing this module, you need to execute:
42+
43+
::
44+
45+
pip3 install pysftp==0.2.9
46+
47+
Configuration
48+
=============
49+
50+
Go to *Settings -> Database Structure -> Automated Backup* to create
51+
your configurations for each database that you needed to backups.
52+
53+
Usage
54+
=====
55+
56+
Keep your Odoo data safe with this module. Take automated back-ups,
57+
remove them automatically and even write them to an external server
58+
through an encrypted tunnel. You can even specify how long local backups
59+
and external backups should be kept, automatically!
60+
61+
Connect with an FTP Server
62+
--------------------------
63+
64+
Keep your data safe, through an SSH tunnel!
65+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66+
67+
Want to go even further and write your backups to an external server?
68+
You can with this module! Specify the credentials to the server, specify
69+
a path and everything will be backed up automatically. This is done
70+
through an SSH (encrypted) tunnel, thanks to pysftp, so your data is
71+
safe!
72+
73+
Test connection
74+
---------------
75+
76+
Checks your credentials in one click
77+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78+
79+
Want to make sure if the connection details are correct and if Odoo can
80+
automatically write them to the remote server? Simply click on the ‘Test
81+
SFTP Connection’ button and you will get message telling you if
82+
everything is OK, or what is wrong!
83+
84+
E-mail on backup failure
85+
------------------------
86+
87+
Stay informed of problems, automatically!
88+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89+
90+
Do you want to know if the database backup succeeded or failed?
91+
Subscribe to the corresponding backup setting notification type.
92+
93+
Run backups when you want
94+
-------------------------
95+
96+
From the backups configuration list, press *More > Execute backup(s)* to
97+
manually execute the selected processes.
98+
99+
|Try me on Runbot|
100+
101+
.. |Try me on Runbot| image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
102+
:target: https://runbot.odoo-community.org/runbot/149/11.0
103+
104+
Known issues / Roadmap
105+
======================
106+
107+
- On larger databases, it is possible that backups will die due to Odoo
108+
server settings. In order to circumvent this without frivolously
109+
changing settings, you need to run the backup from outside of the main
110+
Odoo instance. How to do this (for version 9.0) was outlined in `this
111+
blog
112+
post <https://web.archive.org/web/20240805225230/https://blog.laslabs.com/2016/10/running-python-scripts-within-odoos-environment/>`__.
113+
- Backups won't work if list_db=False is configured in the instance.
114+
115+
Bug Tracker
116+
===========
117+
118+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
119+
In case of trouble, please check there if your issue has already been reported.
120+
If you spotted it first, help us to smash it by providing a detailed and welcomed
121+
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20auto_backup%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
122+
123+
Do not contact contributors directly about support or help with technical issues.
124+
125+
Credits
126+
=======
127+
128+
Authors
129+
-------
130+
131+
* Yenthe Van Ginneken
132+
* Agile Business Group
133+
* Grupo ESOC Ingenieria de Servicios
134+
* LasLabs
135+
* AdaptiveCity
136+
137+
Contributors
138+
------------
139+
140+
- Yenthe Van Ginneken <[email protected]>
141+
- Alessio Gerace <[email protected]>
142+
- Jairo Llopis <[email protected]>
143+
- Dave Lasley <[email protected]>
144+
- Andrea Stirpe <[email protected]>
145+
- Aitor Bouzas <[email protected]>
146+
- Simone Vanin <[email protected]>
147+
- Vu Nguyen Anh <[email protected]>
148+
- Alex Comba <[email protected]>
149+
150+
Maintainers
151+
-----------
152+
153+
This module is maintained by the OCA.
154+
155+
.. image:: https://odoo-community.org/logo.png
156+
:alt: Odoo Community Association
157+
:target: https://odoo-community.org
158+
159+
OCA, or the Odoo Community Association, is a nonprofit organization whose
160+
mission is to support the collaborative development of Odoo features and
161+
promote its widespread use.
162+
163+
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/17.0/auto_backup>`_ project on GitHub.
164+
165+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

auto_backup/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import models

auto_backup/__manifest__.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2004-2009 Tiny SPRL (<http://tiny.be>).
2+
# Copyright 2015 Agile Business Group <http://www.agilebg.com>
3+
# Copyright 2016 Grupo ESOC Ingenieria de Servicios, S.L.U. - Jairo Llopis
4+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
5+
6+
{
7+
"name": "Database Auto-Backup",
8+
"summary": "Backups database",
9+
"version": "17.0.1.0.0",
10+
"author": "Yenthe Van Ginneken, "
11+
"Agile Business Group, "
12+
"Grupo ESOC Ingenieria de Servicios, "
13+
"LasLabs, "
14+
"AdaptiveCity, "
15+
"Odoo Community Association (OCA)",
16+
"license": "AGPL-3",
17+
"website": "https://github.com/OCA/server-tools",
18+
"category": "Tools",
19+
"depends": ["mail"],
20+
"data": [
21+
"data/ir_cron.xml",
22+
"data/mail_message_subtype.xml",
23+
"security/ir.model.access.csv",
24+
"view/db_backup_view.xml",
25+
],
26+
"installable": True,
27+
"external_dependencies": {"python": ["pysftp", "cryptography"]},
28+
}

auto_backup/data/ir_cron.xml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="ir_cron_backup_scheduler_0" model="ir.cron">
4+
<field name="name">Backup Scheduler</field>
5+
<field name="user_id" ref="base.user_root" />
6+
<field name="interval_number">1</field>
7+
<field name="interval_type">days</field>
8+
<field name="numbercall">-1</field>
9+
<field
10+
name="nextcall"
11+
eval="(datetime.now() + timedelta(days=1)).strftime('%Y-%m-%d 03:00:00')"
12+
/>
13+
<field name="model_id" ref="model_db_backup" />
14+
<field name="state">code</field>
15+
<field name="code">model.action_backup_all()</field>
16+
</record>
17+
</odoo>
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="mail_message_subtype_success" model="mail.message.subtype">
4+
<field name="name">Backup Successful</field>
5+
<field name="description">Database backup succeeded.</field>
6+
<field name="res_model">db.backup</field>
7+
<field name="default" eval="False" />
8+
</record>
9+
<record id="mail_message_subtype_failure" model="mail.message.subtype">
10+
<field name="name">Backup Failed</field>
11+
<field name="description">Database backup failed.</field>
12+
<field name="res_model">db.backup</field>
13+
<field name="default" eval="True" />
14+
</record>
15+
</odoo>

0 commit comments

Comments
 (0)