Search 1.9 billion lines of Odoo code on GitHub

odoo_backup_sh

Author: IT-Projects LLC
License: Other OSI approved licence
Branch: 14.0-web_website
Repository: brain-tec/misc-addons
Dependencies: base, iap, mail, and web
Languages: CSS (21, 0.3%), HTML (405, 5.3%), JavaScript (607, 8.0%), Python (1661, 21.9%), SVG (3492, 46.0%), Sass (157, 2.1%), XML (1041, 13.7%), and reStructuredText (208, 2.7%)
Other branches: 11.0, 12.0, 12.0-web_multi_attachment_base, 13.0, 13.0-attachment_large_object, 13.0-project_timelog, 13.0-res_partner_country_code, 14.0-ir_attachment_s3, 14.0-ir_attachment_url, 14.0-trojikman-patch-1, and yelizariev-patch-1
Other repositories: 001101/misc-addons, Banetese/misc-addons, DITIntl/misc-addons, Deanzou/misc-addons, Decikingship/misc-addons, Dobtor-it-projects-llc/misc-addons, Enigma228322/misc-addons, GabbasovDinar/misc-addons, Gio666/misc-addons, Innoria/misc-addons, KolushovAlexandr/misc-addons, KonosCL/misc-addons, MYRCONSULTING/misc-addons, MihranThalhath/misc-addons, NCS-75/misc-addons, Ommo73/misc-addons, Posland/misc-addons, RL-OtherApps/misc-addons, Raniani-lab/misc-addons, SeuMarco/misc-addons, TestMergeBot/misc-addons, UnixedIT/misc-addons, Uppley/misc-addons, Vauxoo/addons-yelizariev, Welltec/misc-addons, aaltinisik/misc-addons, abdo3247/misc-addons, adhoc-dev/misc-addons, antherkiv/misc-addons, aurestic/it-projects-llc-misc-addons, brain-tec/sync-addons, cleqo/misc-addons, cloudtrim/misc-addons, code-pack/misc-addons, corsisa/misc-addons, crtmneric/misc-addons, edvillan15/misc-addons, em230418/misc-addons, em230418/sync-addons, eneldoserrata/misc-addons, eng-eslam-a-y/misc-addons, enleth/misc-addons, eqms/misc-addons, gandad/misc-addons, germanponce/misc-addons, hassanfadl/misc-addons, huntergps/misc-addons, ilmir-k/addons-yelizariev, indexa-git/misc-addons, itpp-labs/misc-addons, itpp-labs/sync-addons, legalsylvain/misc-addons, leonidasthe300/misc-addons, loftwah/misc-addons, maherjaballi/misc-addons, mehdibenhac/misc-addons, mikael85/misc-addons, nabiforks/misc-addons, nurdiny13/misc-addons, oondeo/misc-addons, raouf-haddada/misc-addons, rudisulistyo/misc-addons, sergiocorato/misc-addons, shengyf1/misc-addons, sinandurgut07/misc-addons, sisboca/misc-addons, su69ar/misc-addons, suningwz/misc-addons, trojikman/misc-addons, wahello/misc-addons, xtjie/misc-addons, yelizariev/addons-yelizariev, and yelizariev/sync-addons

<a class="reference external image-reference" href="https://itpp.dev"><img alt="Tested and maintained by IT Projects Labs" src="https://itpp.dev/images/infinity-readme.png" /></a> <a class="reference external image-reference" href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"> </a> <a name="s3-backing-up"></a> <h2>S3 Backing up</h2> <p>Backing up Odoo databases to S3 bucket.</p> <a name="in-app-purchase"></a> <h3>In-App Purchase</h3> <p>IAP IS TEMPORARLY DISABLED.</p> <p><strong>odoo-backup.sh</strong> provides s3 credentials. Payments for the service is managed by proprietary module, which implements <a class="reference external" href="https://www.odoo.com/documentation/13.0/webservices/iap.html">In-App Purchase</a> -- payments platform provided by <em>Odoo S.A.</em>.</p> <a name="personal-cloud"></a> <h3>Personal cloud</h3> <p>Additionally to the cloud provided by <strong>odoo-backup.sh</strong> it's possible to store backups on a personal cloud. In that case user has to arrange credentials himself. Supported cloud providers and protocols are as following:</p> <ul class="simple"> <li><a class="reference external" href="https://apps.odoo.com/apps/modules/13.0/odoo_backup_sh_dropbox/">Dropbox</a></li> <li><a class="reference external" href="https://apps.odoo.com/apps/modules/13.0/odoo_backup_sh_google_disk/">Google Drive</a></li> </ul> <p><em>You need to get corresponding modules to use personal cloud.</em></p> <a name="implementation-details"></a> <h3>Implementation details</h3> <a name="web-database-backups"></a> <h4>/web/database/backups</h4> <p>It's a new page in <em>database manager</em>, that allows to see list of available backups that can be restored. It works <strong>only</strong> with S3 bucket provided by <strong>odoo-backup.sh service</strong>.</p> <p>The page is available via new button <code>[Restore via Odoo-backup.sh]</code> at <em>database manager</em>. It works in the following way:</p> <ul class="simple"> <li>If there are no amazon S3 credentials in the session, the module makes requests to get them:<ul> <li><em>Browser</em> sends request to <code>/web/database/backups</code></li> <li><em>Odoo instance</em> sends request to <code>odoo-backup.sh/get_cloud_params</code> with <code>user_key</code> from the session (the <code>user_key</code> is generated automatically if it's not set).</li> <li><code>odoo-backup.sh</code> <strong>either</strong> returns amazon S3 credentials with which the module can use to send request to S3 independently, <strong>or</strong> <code>odoo-backup.sh</code> doesn't recognise <code>user_key</code> and starts process of authentication via <code>odoo.com</code> as auth provider:<ul> <li><code>odoo-backup.sh/get_cloud_params</code> returns a link to redirect to odoo.com authentication page</li> <li><em>User</em> enters his login-password and is redirected back to <code>/web/database/backups</code> page and the process starts again, but this time <code>odoo-backup.sh</code> recognise <code>user_key</code> and return amazon credentials</li> </ul> </li> </ul> </li> <li>If amazon S3 credentials are in the config file, the module makes request to AWS S3 to get list of users backups and then renders it.</li> </ul> <a name="backup-dashboard"></a> <h4>Backup dashboard</h4> <p>It's a backend page where an user can watch detail information about his backups which are remote stored. Also he can make backup of any of his databases. This backup will be sent to AWS S3 for storing. Moreover the user can create autobackup settings. The settings say to the module at what point of time, from which databases to create backups and max number of backups of database must be store. Backups rotations are supported too.</p> <p>After module installation user can click <code>Get S3 credentials</code>, which start similar process are described above in <code>/web/database/backups</code> section.</p> <a name="manual-testing"></a> <h3>Manual Testing</h3> <p>To test odoo_backup_sh* modules one can use following scenarios:</p> <a name="test-rotation"></a> <h4>Test: rotation</h4> <ul class="simple"> <li>Use database with demo</li> <li>Install <code>odoo_backup_sh</code></li> <li>Open menu <code>[[ Backups ]]</code></li> <li>Click <code>[Get S3 storage]</code></li> <li>At demo Backup Config set any backup schedule</li> <li>Configure rotation to test</li> <li>Go to <code>[[ Settings ]] &gt;&gt; Automation &gt;&gt; Scheduled Actions</code><ul> <li>Find a cron job for backuping and click <code>[Run Manually]</code></li> </ul> </li> <li>Check that backups are rotated according to plan</li> <li>To repeat the test open Backup Config and click <code>[Create Fake Backups]</code></li> </ul> <a name="preparation-install-base-module"></a> <h4>Preparation: Install base module</h4> <ul class="simple"> <li>use database without demo</li> <li>if you previously installed backup modules, then uninstall them and delete <code>odoo_backup_sh.*</code> params in <code>[[ Settings ]] &gt;&gt; System Parameters</code>.</li> <li>install <code>odoo_backup_sh</code></li> </ul> <a name="test-iap-s3"></a> <h3>Test: IAP S3</h3> <ul class="simple"> <li>Install base module</li> <li>Click <code>[Get S3 storage]</code></li> <li>Create Schedule for current database. Test from this step should be proceeded in two different scenarios: with encryption disabled and enabled</li> <li>Test according to <em>Checklist: Backups</em></li> </ul> <p>Restoring without downloading:</p> <ul class="simple"> <li>In new incognito window open <code>/web/database/manager</code></li> <li>In <code>Odoo-backup.sh</code> section restore database</li> <li>Login to the restored database -- all scheduled backuping must be disabled</li> </ul> <a name="test-s3"></a> <h4>Test: S3</h4> <ul class="simple"> <li>Install base module</li> <li>Configure private S3 credentials according to the instruction</li> <li>Create Schedule for current database.</li> <li>Test according to <em>Checklist: Backups</em></li> </ul> <a name="checklist-backups"></a> <h4>Checklist: Backups</h4> <ul class="simple"> <li>Directly at the storage: create manually some file to check that modules can handle them:<ul> <li>a file with random name</li> <li>a backup without corresponding <code>*.info</code> file</li> <li>a backup info file without backup itself</li> </ul> </li> <li>Go to <code>[[ Settings ]] &gt;&gt; Automation &gt;&gt; Scheduled Actions</code><ul> <li>Find a cron job for backuping and click <code>[Run Manually]</code></li> </ul> </li> <li>Go to <code>[[ Settings ]] &gt;&gt; Backups</code><ul> <li>Find just created backup</li> <li>Click <code>[Download]</code></li> <li>If database is encrypted, decrypt it as described in <a class="reference external" href="doc/index.rst">doc/index.rst</a></li> <li>Restore database in a usual way</li> </ul> </li> </ul> <p>Manual backups:</p> <ul class="simple"> <li>Go to Dashboard</li> <li>Click <code>[Make backup now]</code></li> <li>Download the backup again as described above</li> </ul> <p>Syncing with remote backups:</p> <ul class="simple"> <li>Directly at the storage:<ul> <li>copy archive for a backup and set new name (e.g. change year of the backup)</li> <li>copy info file of the backup and make corresponing name in its name and content</li> </ul> </li> <li>Go to <code>[[ Settings ]] &gt;&gt; Automation &gt;&gt; Scheduled Actions</code><ul> <li>Find a cron job for backuping and click <code>[Run Manually]</code></li> </ul> </li> <li>Go to <code>[[ Settings ]] &gt;&gt; Backups</code><ul> <li>Check that copied backup has a record in Backup list. If there is no one, be sure that the Backup Settings doesn't have rotations.</li> <li>Download the backup</li> </ul> </li> </ul> <a name="test-dropbox-only"></a> <h4>Test: Dropbox only</h4> <ul class="simple"> <li><em>Install base module</em></li> <li>Install <code>odoo_backup_sh_dropbox</code> module</li> <li>Configure dropbox according to the module's documentation</li> <li>Create Schedule for any database</li> <li>Test according to <em>Checklist: Backups</em></li> </ul> <a name="test-all-storages"></a> <h4>Test: All storages</h4> <ul class="simple"> <li><em>Install base module</em></li> <li>Install <code>odoo_backup_sh_dropbox</code> module</li> <li>Install <code>odoo_backup_sh_google_disk</code> module</li> <li>Configure S3 only credentials, Create Schedule</li> <li>Test according to <em>Checklist: Backups</em></li> <li>Configure Dropbox credentials, Create Schedule</li> <li>Test according to <em>Checklist: Backups</em></li> <li>Configure Google Drive credentials, Create Schedule</li> <li>Test according to <em>Checklist: Backups</em></li> </ul> <a name="test-iap-notification"></a> <h4>Test: IAP Notification</h4> <p>TODO</p> <a name="test-iap-credits"></a> <h4>Test: IAP Credits</h4> <p>TODO: Check purchasing, top-up, using credits, running out of credits</p> <a name="roadmap"></a> <h3>Roadmap</h3> <ul class="simple"> <li>All backups modules should be refactored and cleaned up.<ul> <li>See TODOs in code</li> <li>odoo_backup_sh.py files should splitted according to odoo guidelines</li> </ul> </li> <li>non-active records in config_cron_ids should be visible. But visibility of warning and rotation fields should depend on active crons only</li> </ul> <a name="questions"></a> <h3>Questions?</h3> <p>To get an assistance on this module contact us by email :arrow_right: <a class="reference external" href="mailto:help&#64;itpp.dev">help&#64;itpp.dev</a></p> <a name="contributors"></a> <h3>Contributors</h3> <ul class="simple"> <li><a class="reference external" href="https://it-projects.info/team/ufaks">Stanislav Krotov</a></li> <li><a class="reference external" href="https://it-projects.info/team/yelizariev">Ivan Yelizariev</a></li> </ul> <a name="further-information"></a> <h3>Further information</h3> <p>Odoo Apps Store: <a class="reference external" href="https://apps.odoo.com/apps/modules/14.0/odoo_backup_sh/">https://apps.odoo.com/apps/modules/14.0/odoo_backup_sh/</a></p> <p>Tested on <a class="reference external" href="https://github.com/odoo/odoo/commit/bbcefc0cd5b5aa2285a577118f918742bac670c4">Odoo 14.0</a></p>