-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[MIG][10.0] auto_backup #614
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 all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
6835134
Update english pot file
Yenthe666 d81148f
Dutch translations
Yenthe666 b13a07d
Chinese translations
Yenthe666 52a57ea
Changes chinese translation
Yenthe666 baa791f
Full German translations
Yenthe666 fce152b
Typo fix
Yenthe666 6484f3b
Flemish translations
Yenthe666 422fe2a
Open FTP session on the last moment possible
archetipo 5b3e831
Porting module to OCA 8.0
archetipo 9129d7d
[FIX] module
archetipo 859239b
[FIX] bug logger --> _logger call
archetipo dee2ee4
[FIX] Readme.rst
archetipo 006a1e8
[FIX] defaults value
archetipo 3cc3ef2
[FIX] rebased commit
archetipo 9869e78
[RM] description index.html
archetipo 634b07b
[RF] porting to new api
archetipo b1d853c
[FIX] test
archetipo b39b6ae
[FIX] flake8
archetipo 5732f38
[IMP] deps in travis.yml
archetipo 76f2ebe
[FIX] flake8 and pylint
archetipo b88f7fa
[FIX] name of file
archetipo c1fae69
[FIX] autoremove method
archetipo a38e15c
[FIX] mail.tempale seems not work in cron task, replaced with direct…
archetipo dd564d1
[FIX] Readme
archetipo 37bf876
[FIX] review remarks
archetipo 36e8c37
[FIX] handled ssl hosts
archetipo 9f42da0
[FIX] handled ssl hosts
archetipo 7687908
[FIX] fixed, last review remarks
archetipo ec314b9
[FIX] travis lint check
archetipo 3a0f71e
[FIX] backup only local db , beacause xmlrpc call of dump cause memor…
archetipo 7253a9a
[RM] useless field
archetipo 0eb0dc9
[FIX] check_dd method
archetipo d1899bb
[auto_backup] Refactor.
58a8ac7
Reduce headers.
7164c8a
Fix view format.
afd1595
Add shortcut to execute backups from the "More" menu.
c63a7d5
Avoid duplicated backups.
71f4a14
Make sure you don't backup inside the filestore folder.
c70098f
[FIX] This was removing all databases.
bdb17f2
FIX License type
archetipo d295521
OCA Transbot updated translations from Transifex
oca-transbot 3aa3687
OCA Transbot updated translations from Transifex
oca-transbot 0eef6c4
OCA Transbot updated translations from Transifex
oca-transbot ba6c986
[FIX] auto_backup: bad reference to field sftp_private_key (#423)
jabibi d78f7a9
[FIX] auto_backup: Empty dump using sftp backup option (#432)
jabibi df026d7
[FIX] logger db_backup for pysftp (#419)
bealdav ff45639
OCA Transbot updated translations from Transifex
oca-transbot ed124d6
OCA Transbot updated translations from Transifex
oca-transbot aaa7d95
OCA Transbot updated translations from Transifex
oca-transbot 7220128
OCA Transbot updated translations from Transifex
oca-transbot 8c4d5da
[FIX] remove en.po that was erroneously created by transbot
sbidoul a385974
[MIG] auto_backup: Migrate to v9
lasley c46a309
[ADD] auto_backup: Test coverage
lasley 4c77da4
[MIG] auto_backup: Update to v10
lasley d0445a2
[IMP] auto_backup: Add timeout note & blog link
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,116 @@ | ||
| .. 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/10.0 | ||
|
|
||
| Known issues / Roadmap | ||
| ====================== | ||
|
|
||
| * On larger databases, it is possible that backups will die due to Odoo server | ||
| settings. In order to circumvent this without frivolously changing settings, | ||
| you need to run the backup from outside of the main Odoo instance. How to do | ||
| this is outlined in `this blog post | ||
| <https://blog.laslabs.com/2016/10/running-python-scripts-within-odoos-environment/>`_. | ||
|
|
||
| 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 <yenthe.vanginneken@vanroey.be> | ||
| * Alessio Gerace <alessio.gerace@agilebg.com> | ||
| * Jairo Llopis <yajo.sk8@gmail.com> | ||
| * Dave Lasley <dave@laslabs.com> | ||
|
|
||
| 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,36 @@ | ||
| # -*- 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": "10.0.1.0.0", | ||
| "author": ( | ||
| "Yenthe Van Ginneken, " | ||
| "Agile Business Group, " | ||
| "Grupo ESOC Ingeniería de Servicios, " | ||
| "LasLabs, " | ||
| "Odoo Community Association (OCA)" | ||
| ), | ||
| 'license': "AGPL-3", | ||
| "website": "http://www.vanroey.be/applications/bedrijfsbeheer/odoo", | ||
| "category": "Tools", | ||
| "depends": [ | ||
| 'base_setup', | ||
| 'mail', | ||
| ], | ||
| "data": [ | ||
| "data/ir_cron.xml", | ||
| "data/mail_message_subtype.xml", | ||
| "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,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <odoo noupdate="1"> | ||
|
|
||
| <record id="ir_cron_backup_scheduler_0" model="ir.cron"> | ||
| <field name="name">Backup Scheduler</field> | ||
| <field name="user_id" ref="base.user_root" /> | ||
| <field name="interval_number">1</field> | ||
| <field name="interval_type">days</field> | ||
| <field name="numbercall">-1</field> | ||
| <field name="nextcall" | ||
| eval="(datetime.now() + timedelta(days=1)).strftime('%Y-%m-%d 02:00:00')" | ||
| /> | ||
| <field name="model">db.backup</field> | ||
| <field name="function">action_backup_all</field> | ||
| </record> | ||
|
|
||
| </odoo> |
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,19 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <odoo noupdate="1"> | ||
|
|
||
| <record id="mail_message_subtype_success" model="mail.message.subtype"> | ||
| <field name="name">Backup Successful</field> | ||
| <field name="description">Database backup succeeded.</field> | ||
| <field name="res_model">db.backup</field> | ||
| <field name="default" eval="False" /> | ||
| </record> | ||
|
|
||
| <record id="mail_message_subtype_failure" model="mail.message.subtype"> | ||
| <field name="name">Backup Failed</field> | ||
| <field name="description">Database backup failed.</field> | ||
| <field name="res_model">db.backup</field> | ||
| <field name="default" eval="True" /> | ||
| </record> | ||
|
|
||
| </odoo> |
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.
We ran into an issue where backup execution was dying when running inside of Odoo due to the timeouts configured on the instance. We had to make a small script to run this system outside of the main Odoo instance to circumvent this, which is described in this blog post.
If this is something other people have run into as well, maybe transferring some of that info to this ReadMe would be of use?