-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[9.0][MIG] auto_backup #526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 87 commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
4e31d62
Update english pot file
Yenthe666 5ecc9d4
Dutch translations
Yenthe666 8317cb0
Chinese translations
Yenthe666 4dc62da
Changes chinese translation
Yenthe666 1e44fb4
Full German translations
Yenthe666 3577bdc
Typo fix
Yenthe666 6d4b34e
Flemish translations
Yenthe666 9255774
Open FTP session on the last moment possible
archetipo 5dfc524
Porting module to OCA 8.0
archetipo da98bcb
[FIX] module
archetipo d345a71
[FIX] bug logger --> _logger call
archetipo 680ca85
[FIX] Readme.rst
archetipo c6ac088
[FIX] defaults value
archetipo 93804fa
[FIX] rebased commit
archetipo 2ac9136
[RM] description index.html
archetipo 1f76872
[RF] porting to new api
archetipo 0d9dd41
[FIX] test
archetipo 9839fb6
[FIX] flake8
archetipo 94df002
[IMP] deps in travis.yml
archetipo b9e9fec
[FIX] flake8 and pylint
archetipo d70ee0a
[FIX] name of file
archetipo 788439d
[FIX] autoremove method
archetipo 749e236
[FIX] mail.tempale seems not work in cron task, replaced with direct…
archetipo 09c2c77
[FIX] Readme
archetipo bfa2b96
[FIX] review remarks
archetipo fd65859
[FIX] handled ssl hosts
archetipo 0e27870
[FIX] handled ssl hosts
archetipo 8da47b1
[FIX] fixed, last review remarks
archetipo e67a490
[FIX] travis lint check
archetipo ef75129
[FIX] backup only local db , beacause xmlrpc call of dump cause memor…
archetipo 98c9662
[RM] useless field
archetipo 75a6937
[FIX] check_dd method
archetipo 7a0aa8e
[auto_backup] Refactor.
f7efa3c
Update english pot file
Yenthe666 d5c3b44
Dutch translations
Yenthe666 4a5ce89
Chinese translations
Yenthe666 18d6154
Changes chinese translation
Yenthe666 c068871
Full German translations
Yenthe666 a22429d
Typo fix
Yenthe666 b676a2d
Flemish translations
Yenthe666 60f9ebc
Open FTP session on the last moment possible
archetipo 96c3fea
Porting module to OCA 8.0
archetipo b08cc78
[FIX] module
archetipo 44ee1be
[FIX] bug logger --> _logger call
archetipo 7d87f27
[FIX] Readme.rst
archetipo f7a1b95
[FIX] defaults value
archetipo 58fcdf1
[FIX] rebased commit
archetipo 9008dd2
[RM] description index.html
archetipo 8c92cc8
[RF] porting to new api
archetipo a90e2a1
[FIX] test
archetipo 6e5b4b1
[FIX] flake8
archetipo 62cde21
[IMP] deps in travis.yml
archetipo d635cc3
[FIX] flake8 and pylint
archetipo 72fd550
[FIX] name of file
archetipo b70bb98
[FIX] autoremove method
archetipo 74b6f77
[FIX] mail.tempale seems not work in cron task, replaced with direct…
archetipo fa06594
[FIX] Readme
archetipo 2439bdf
[FIX] review remarks
archetipo 14f05d5
[FIX] handled ssl hosts
archetipo e4199d0
[FIX] handled ssl hosts
archetipo f14e80a
[FIX] fixed, last review remarks
archetipo f6df00d
[FIX] travis lint check
archetipo 4da20e6
[FIX] backup only local db , beacause xmlrpc call of dump cause memor…
archetipo 15ba457
[RM] useless field
archetipo d3781e9
[FIX] check_dd method
archetipo 5510924
[auto_backup] Refactor.
e3eef86
Merge branch 'porting_auto_backup_oca' of github.com:archetipo/server…
archetipo 13d3b87
Reduce headers.
91d959a
Fix view format.
b96b663
Add shortcut to execute backups from the "More" menu.
fef126e
Avoid duplicated backups.
b52d0de
Make sure you don't backup inside the filestore folder.
4773b87
[FIX] This was removing all databases.
8a8a6f6
FIX License type
archetipo 46892bc
OCA Transbot updated translations from Transifex
oca-transbot 118db13
OCA Transbot updated translations from Transifex
oca-transbot 0ce5cab
OCA Transbot updated translations from Transifex
oca-transbot c275916
[FIX] auto_backup: bad reference to field sftp_private_key (#423)
jabibi 10d9356
[FIX] auto_backup: Empty dump using sftp backup option (#432)
jabibi 59fadd6
[FIX] logger db_backup for pysftp (#419)
bealdav 639f2ff
OCA Transbot updated translations from Transifex
oca-transbot bb31c29
OCA Transbot updated translations from Transifex
oca-transbot 9dcf82b
OCA Transbot updated translations from Transifex
oca-transbot 6d28ffa
OCA Transbot updated translations from Transifex
oca-transbot ca9b447
[FIX] remove en.po that was erroneously created by transbot
sbidoul 20da1fa
Merge branch '8.0-extract' into release/9.0/auto_backup
lasley f150424
[MIG] auto_backup: Migrate to v9
lasley f6b77ce
[ADD] auto_backup: Test coverage
lasley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
==================== | ||
Database Auto-Backup | ||
==================== | ||
|
||
A tool for all your back-ups, internal and external! | ||
|
||
Installation | ||
============ | ||
|
||
Before installing this module, you need to execute:: | ||
|
||
pip install pysftp | ||
|
||
Configuration | ||
============= | ||
|
||
Go to *Settings -> Configuration -> Configure Backup* to | ||
create your configurations for each database that you needed | ||
to backups. | ||
|
||
Usage | ||
===== | ||
|
||
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 succeeded or failed? Subscribe to | ||
the corresponding backup setting notification type. | ||
|
||
Run backups when you want | ||
------------------------- | ||
|
||
From the backups configuration list, press *More > Execute backup(s)* to | ||
manually execute the selected processes. | ||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/149/9.0 | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/server-tools/issues>`_. In case of trouble, please | ||
check there if your issue has already been reported. If you spotted it first, | ||
help us smashing it by providing a detailed and welcomed feedback. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Yenthe Van Ginneken <[email protected]> | ||
* Alessio Gerace <[email protected]> | ||
* Jairo Llopis <[email protected]> | ||
* Dave Lasley <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit https://odoo-community.org. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2004-2009 Tiny SPRL (<http://tiny.be>). | ||
# © 2015 Agile Business Group <http://www.agilebg.com> | ||
# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis | ||
# License GPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). | ||
|
||
from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2004-2009 Tiny SPRL (<http://tiny.be>). | ||
# © 2015 Agile Business Group <http://www.agilebg.com> | ||
# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis | ||
# License GPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). | ||
|
||
{ | ||
"name": "Database Auto-Backup", | ||
"summary": "Backups database", | ||
"version": "9.0.1.0.0", | ||
"author": ( | ||
"VanRoey.be - Yenthe Van Ginneken, Agile Business Group," | ||
" Grupo ESOC Ingeniería de Servicios," | ||
" Odoo Community Association (OCA)" | ||
), | ||
'license': "AGPL-3", | ||
"website": "http://www.vanroey.be/applications/bedrijfsbeheer/odoo", | ||
"category": "Tools", | ||
"depends": ['mail'], | ||
"data": [ | ||
"data/backup_data.yml", | ||
"security/ir.model.access.csv", | ||
"view/db_backup_view.xml", | ||
], | ||
"application": True, | ||
"installable": True, | ||
"external_dependencies": { | ||
"python": ["pysftp"], | ||
}, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
# Cron job | ||
- !record {model: ir.cron, id: ir_cron_backupscheduler0}: | ||
name: Backup scheduler | ||
user_id: base.user_root | ||
interval_number: 1 | ||
interval_type: days | ||
numbercall: -1 | ||
nextcall: !eval | ||
(datetime.now() + timedelta(days=1)).strftime("%Y-%m-%d 02:00:00") | ||
model: db.backup | ||
function: action_backup_all | ||
|
||
# New message subtypes | ||
- !record {model: mail.message.subtype, id: success}: | ||
name: Backup successful | ||
res_model: db.backup | ||
default: False | ||
description: Database backup succeeded. | ||
|
||
- !record {model: mail.message.subtype, id: failure}: | ||
name: Backup failed | ||
res_model: db.backup | ||
default: True | ||
description: Database backup failed. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arenot yml test files deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are they? I would admittedly be very happy about that. Where'd you see this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where: I will try to track down...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this? odoo/odoo#6287 (comment) YAML is not listed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no mention of it in v9 doc: https://www.odoo.com/documentation/9.0/reference/testing.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome well that just made me incredibly happy - I hate the YML tests. I'll move this to Python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrobaeza do you have any pointer about the fact they are removed in v10? or deprecated in v9? May be we should discuss it at the OCA... I think it's a bit late to require no YAML test anymore in v9 given the OCA is already late on that v9 transition...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see in the comment above (odoo/odoo#6287 (comment)) the removal part. About deprecation, I don't remember where it was said, but it has been stated several times.
I see no point in discussing this: if the author of the PR agrees to change the test, perfect. If not, better YML test than nothing. In v10 we will need to change them. It's not a blocking point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedrobaeza well if we still accept YML tests on 9.0 that's fine for me. The contrary would have annoyed me cause it would have slowed migration a bit too much... On the contrary, 9.0 to 10.0 migration should be pretty straightforward so it will be easier to bite the bullet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case we're talking maybe a ten minute conversion too, so really not too much skin off my back even if I didn't already want to see YML die in a fire 😄
Just to note though, this isn't a test - it's the cron and message data.