@ -0,0 +1,51 @@ |
|||
.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg |
|||
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
|||
:alt: License: LGPL-3 |
|||
|
|||
Automatic Database Backup To Local Server, Remote Server, Google Drive, Dropbox, Onedrive, Nextcloud and Amazon S3 |
|||
================================================================================================================== |
|||
* Generate Database Backups and store to multiple locations |
|||
|
|||
Configuration |
|||
============ |
|||
- www.odoo.com/documentation/18.0/setup/install.html |
|||
- Install our custom addon |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (LGPL v3). |
|||
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
Credits |
|||
------- |
|||
* Developers : (v15) Midilaj, |
|||
(v16) Midilaj, |
|||
(v16 Amazon S3,NextCloud) Anfas Faisal K, |
|||
(v17) Aslam A K, |
|||
(v18) Aslam A K |
|||
Contact : odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import controllers |
|||
from . import models |
|||
from . import wizard |
@ -0,0 +1,51 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
{ |
|||
'name': "Automatic Database Backup To Local Server, Remote Server," |
|||
"Google Drive, Dropbox, Onedrive, Nextcloud and Amazon S3 Odoo18", |
|||
'version': '18.0.1.0.0', |
|||
'live_test_url': 'https://youtu.be/Q2yMZyYjuTI', |
|||
'category': 'Extra Tools', |
|||
'summary': 'Odoo Database Backup, Automatic Backup, Database Backup, Automatic Backup,Database auto-backup, odoo backup' |
|||
'google drive, dropbox, nextcloud, amazon S3, onedrive or ' |
|||
'remote server, Odoo18, Backup, Database, Odoo Apps', |
|||
'description': 'Odoo Database Backup, Database Backup, Automatic Backup, automatic database backup, odoo18, odoo apps,backup, automatic backup,odoo18 automatic database backup,backup google drive,backup dropbox, backup nextcloud, backup amazon S3, backup onedrive', |
|||
'author': "Cybrosys Techno Solutions", |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': "https://www.cybrosys.com", |
|||
'depends': ['base', 'mail'], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'data/ir_cron_data.xml', |
|||
'data/mail_template_data.xml', |
|||
'views/db_backup_configure_views.xml', |
|||
'wizard/dropbox_auth_code_views.xml', |
|||
], |
|||
'external_dependencies': { |
|||
'python': ['dropbox', 'pyncclient', 'boto3', 'nextcloud-api-wrapper','paramiko']}, |
|||
'images': ['static/description/banner.gif'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import auto_database_backup |
@ -0,0 +1,54 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
import json |
|||
from odoo import http |
|||
from odoo.http import request |
|||
|
|||
|
|||
class OnedriveAuth(http.Controller): |
|||
"""Controller for handling authentication with OneDrive and Google Drive.""" |
|||
@http.route('/onedrive/authentication', type='http', auth="public") |
|||
def oauth2callback(self, **kw): |
|||
""" |
|||
Callback function for OneDrive authentication. |
|||
|
|||
:param kw: A dictionary of keyword arguments. |
|||
:return: A redirect response. |
|||
""" |
|||
state = json.loads(kw['state']) |
|||
backup_config = request.env['db.backup.configure'].sudo().browse( |
|||
state.get('backup_config_id')) |
|||
backup_config.get_onedrive_tokens(kw.get('code')) |
|||
backup_config.hide_active = True |
|||
backup_config.active = True |
|||
return request.redirect(state.get('url_return')) |
|||
|
|||
@http.route('/google_drive/authentication', type='http', auth="public") |
|||
def gdrive_oauth2callback(self, **kw): |
|||
"""Callback function for Google Drive authentication.""" |
|||
state = json.loads(kw['state']) |
|||
backup_config = request.env['db.backup.configure'].sudo().browse( |
|||
state.get('backup_config_id')) |
|||
backup_config.get_gdrive_tokens(kw.get('code')) |
|||
backup_config.hide_active = True |
|||
backup_config.active = True |
|||
return request.redirect(state.get('url_return')) |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
<!-- Schedule action for generating automatic database backup--> |
|||
<record id="ir_cron_auto_db_backup" model="ir.cron"> |
|||
<field name="name">Backup : Automatic Database Backup</field> |
|||
<field name="model_id" ref="model_db_backup_configure"/> |
|||
<field name="state">code</field> |
|||
<field name="code">model._schedule_auto_backup()</field> |
|||
<field name="interval_number">1</field> |
|||
<field name="interval_type">days</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,192 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
<data> |
|||
<!-- Database backup operation Successful email template--> |
|||
<record id="mail_template_data_db_backup_successful" model="mail.template"> |
|||
<field name="name">Database Backup: Notification Successful</field> |
|||
<field name="model_id" ref="auto_database_backup.model_db_backup_configure"/> |
|||
<field name="subject">Database Backup Successful: {{ object.db_name }}</field> |
|||
<field name="email_to">{{ object.user_id.email_formatted }}</field> |
|||
<field name="body_html" type="html"> |
|||
<div style="margin: 0px; padding: 0px;"> |
|||
<p style="margin: 0px;"> |
|||
<span>Dear <t t-out="object.user_id.name"/>, |
|||
</span> |
|||
<br/> |
|||
<br/> |
|||
<span style="margin-top: 8px;">Backup of the database |
|||
<i> |
|||
<t t-out="object.db_name"/> |
|||
</i> |
|||
has been successfully generated and stored to |
|||
<t t-if="object.backup_destination == 'local'"> |
|||
<i>Local</i> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'google_drive'"> |
|||
<i>Google Drive</i> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'ftp'"> |
|||
<i>FTP Server</i> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'sftp'"> |
|||
<i>SFTP Server</i> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'dropbox'"> |
|||
<i>Dropbox</i> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'onedrive'"> |
|||
<i>Onedrive</i> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'next_cloud'"> |
|||
<i>NextCloud</i> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'amazon_s3'"> |
|||
<i>Amazon S3</i> |
|||
</t> |
|||
. |
|||
<br/> |
|||
<br/> |
|||
Database Name: |
|||
<t t-out="object.db_name"/> |
|||
<br/> |
|||
Destination: |
|||
<t t-if="object.backup_destination == 'local'"> |
|||
Local |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'google_drive'"> |
|||
Google Drive |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'ftp'"> |
|||
FTP Server |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'sftp'"> |
|||
SFTP Server |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'dropbox'"> |
|||
Dropbox |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'onedrive'"> |
|||
Onedrive |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'next_cloud'"> |
|||
NextCloud |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'amazon_s3'"> |
|||
Amazon S3 |
|||
</t> |
|||
<t t-if="object.backup_destination in ('local', 'ftp', 'sftp', 'dropbox')"> |
|||
<br/> |
|||
Backup Path: |
|||
<t t-if="object.backup_destination == 'local'"> |
|||
<t t-out="object.backup_path"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'ftp'"> |
|||
<t t-out="object.ftp_path"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'sftp'"> |
|||
<t t-out="object.sftp_path"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'dropbox'"> |
|||
<t t-out="object.dropbox_folder"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'next_cloud'"> |
|||
<t t-out="object.nextcloud_folder_key"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'amazon_s3'"> |
|||
<t t-out="object.aws_folder_name"/> |
|||
</t> |
|||
</t> |
|||
<br/> |
|||
Backup Type: |
|||
<t t-out="object.backup_format"/> |
|||
<br/> |
|||
Backup FileName: |
|||
<t t-out="object.backup_filename"/> |
|||
</span> |
|||
</p> |
|||
</div> |
|||
</field> |
|||
</record> |
|||
<!-- Database backup operation failed email templated--> |
|||
<record id="mail_template_data_db_backup_failed" model="mail.template"> |
|||
<field name="name">Database Backup: Notification Failed</field> |
|||
<field name="model_id" ref="auto_database_backup.model_db_backup_configure"/> |
|||
<field name="subject">Database Backup Failed: {{ object.db_name }}</field> |
|||
<field name="email_to">{{ object.user_id.email_formatted }}</field> |
|||
<field name="body_html" type="html"> |
|||
<div style="margin: 0px; padding: 0px;"> |
|||
<p style="margin: 0px;"> |
|||
<span>Dear <t t-out="object.user_id.name"/>, |
|||
</span> |
|||
<br/> |
|||
<br/> |
|||
<span style="margin-top: 8px;">Backup generation of the database |
|||
<i> |
|||
<t t-out="object.db_name"/> |
|||
</i> |
|||
has been Failed. |
|||
<br/> |
|||
<br/> |
|||
Database Name: <t t-out="object.db_name"/> |
|||
<br/> |
|||
Destination: |
|||
<t t-if="object.backup_destination == 'local'"> |
|||
Local |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'google_drive'"> |
|||
Google Drive |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'ftp'"> |
|||
FTP Server |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'sftp'"> |
|||
SFTP Server |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'dropbox'"> |
|||
Dropbox |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'onedrive'"> |
|||
Onedrive |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'next_cloud'"> |
|||
NextCloud |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'amazon_s3'"> |
|||
Amazon S3 |
|||
</t> |
|||
<t t-if="object.backup_destination in ('local', 'ftp', 'sftp', 'dropbox','next_cloud','amazon_s3')"> |
|||
<br/> |
|||
Backup Path: |
|||
<t t-if="object.backup_destination == 'local'"> |
|||
<t t-out="object.backup_path"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'ftp'"> |
|||
<t t-out="object.ftp_path"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'sftp'"> |
|||
<t t-out="object.sftp_path"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'dropbox'"> |
|||
<t t-out="object.dropbox_folder"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'next_cloud'"> |
|||
<t t-out="object.nextcloud_folder_key"/> |
|||
</t> |
|||
<t t-elif="object.backup_destination == 'amazon_s3'"> |
|||
<t t-out="object.aws_folder_name"/> |
|||
</t> |
|||
</t> |
|||
<br/> |
|||
Backup Type: <t t-out="object.backup_format"/> |
|||
<br/> |
|||
<br/> |
|||
<b>Error Message:</b> |
|||
<br/> |
|||
<i><t t-out="object.generated_exception"/></i> |
|||
</span> |
|||
</p> |
|||
</div> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,7 @@ |
|||
## Module <auto_database_backup> |
|||
|
|||
#### 26.08.2024 |
|||
#### Version 18.0.1.0.0 |
|||
#### ADD |
|||
|
|||
- Initial commit for auto_database_backup |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import db_backup_configure |
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 912 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 107 KiB |
After Width: | Height: | Size: 171 KiB |
After Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 175 KiB |
After Width: | Height: | Size: 65 KiB |