Skip to Content
Menu

Auto backup for SaaS kit

by
Odoo

873.20

v 18.0 Third Party
Live Preview
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies eCommerce (website_sale)
Discuss (mail)
Website (website)
Invoicing (account)
Community Apps Dependencies
Lines of code 71043
Technical Name bk_saas_auto_backup
LicenseOPL-1
Websitehttps://bytekol.com
Versions 17.0 18.0
You bought this module and need support? Click here!

Automatic Backup for Odoo Entities

This module provides the following features:
  1. Automatically back up odoo entities
  2. Allow configuration of backup frequency (daily, weekly, monthly) and backup retention period.
  3. Automatically delete backups if the retention period has expired
  4. Record the history of automatic backups, and generate statistics on backed-up Odoo entities and Odoo entities that encountered errors during the backup process.
  5. Allow flexible configuration of Odoo entities for automatic backup, including: all Odoo entities, customer Odoo entities, paid Odoo entities (excluding trial entities), and customizable selection via search domain.
User manual
1. Configuration Guide

After installing the module, a default configuration file for automatic backup will be created. You can edit this default record to customize the backup settings as needed.

Explain Fields

  1. Name: Config name
  2. Apply For: Allows to select Odoo entities that will be automatically backed up, this field will automatically compute the Domain field
  3. Domain: This is the search domain that determines which odoo entities will be automatically backed up.
  4. Odoo Entity (boxed in red), these are the odoo entities records that will be backed up according to the configuration. If you don't see any odoo entity records, you may have configured the domain incorrectly. Please click the "Test Get Odoo Entities" button to see the error details.
  5. Details:
    1. Frequency Backup frequency configuration
    2. Description Description of configuration details
    3. Retention Backups Allows configuring the maximum number of backups to keep in frequency.
      For daily backup configuration, it will automatically backup daily, and Retention Backups will configure the delete date of that backup. For example:
      with 'Daily' backup and 'Retention Backups' is 7, it will back up daily and keep 7 backups of the most recent 7 days compared to the current. If 'Retention Backups' is 3, it will only keep 3 backups of the most recent 3 days compared to the current, the older automatic backups will be deleted.
2. Turn off automatic backup

You can turn off automatic backup by turning off (set active=False) for cron "SaaS: Auto backup odoo entities". or archive the "Auto Backup Entities Configs" records or turn off automatic backup for a single odoo entity like the image below
Please do not uninstall the module to avoid affecting the data.

Operation explanation and testing.

There are 2 new Scheduled actions (cron) created:

  1. SaaS: Auto backup odoo entities: Automatically backup odoo entities according to configuration
  2. SaaS: Delete auto backup entities: Automatically delete odoo entity backups that have reached their deletion date

About how it works, cron will run periodically by default every 12 hours/1 time to check and automatically backup odoo entities. After successfully backing up an odoo entity, the commit will be pushed to the database immediately.

  1. If an error occurs during the backup of another record later, it will not be rolled back. And the error will be recorded in Reporting/Action Histories menu.
  2. If the backup is successful, the backup history will be recorded as shown in the screenshot below:
  3. Automatic deletion of backup records will be performed every 12 hours. When the backup record reaches the "Auto Delete Date", it will be deleted. Deletion will also delete the backup file on the server.
  4. Customer can see that the record is auto backup on the website and can see the auto delete date. By default, customers cannot delete automatic backups, but if the server is theirs (dedicated server, on-premise), they can delete them because the backup is stored on their server.
  5. Testing: the module has been manually tested and has automated test cases to test, test case details are in the module: test_bk_saas_auto_backup We can consider a test case as follows, with default backup configuration as shown below: Suppose we have 2 odoo entities configured for automatic backup. And the module installation date is 2025 March 4.
    Because the configuration record has a backup frequency of monthly, weekly and daily. And keep the last 3 monthly backup records, the last 2 weekly backup records, and the last 7 daily backup records.
    1. - March 4, 2025: Cron runs automatically, checking if there is no automatic backup in the month for 2 odoo entities, so it will proceed to back up those 2 odoo entities. Because the backup record of the month is also the backup record for the week and for the current day, there will only be 1 automatic backup record generated with the automatic deletion date being
      (because it keeps the 3 most recent monthly backups).
      - From March 5, 2025 to March 9, 2025, every day it will automatically create a new backup record for odoo entities, the backup's deletion date is backup's creation date + 7 days.
      - By March 10, 2025, the new week (Monday), the system could not find a backup for the new week so it automatically created a weekly backup for that day, (its deletion date will be March 24, 2025) + 2 weeks because the configuration keeps the 2 most recent weekly backups.
      - March 11 and 12 will create new daily backups, for March 12 the system will delete the daily backups backed up from March 5 because the deletion date has come.

      The process of creating backup and deleting backup will be repeated like that. With the above configuration, an odoo entity will have 3 most recent monthly backups, 2 most recent weekly backups, and 7 most recent daily backups.

      Note that monthly backups may overlap with weekly/daily backups. Weekly backups may overlap with daily backups.

      Monthly backups will usually be created at the beginning of the month, similar to weekly backups. If the beginning of the month/beginning of the week is not backed up due to errors, ... then it will create a backup for the month/week on the next day.
Q&A
  1. Where are automatic backups stored?
    - The automatic backup will be stored on the remote server, each odoo entity have a Odoo Server Group record and the backup will be stored on the Backup Server in that odoo server group.
    Currently, 1 odoo server group only has 1 backup server. We can improve in the future to allow setting up multiple backup servers on the same odoo server group to store backups on many different servers/locations (ensuring no problems when a backup server is broken).
  2. Can I have multiple backup configurations for each policy?
    - Yes, you can have multiple backup configurations. For example, a backup configuration that keeps the last 12 monthly backups for paid odoo entities with plan A and another configuration that keeps only the last 1 monthly backup for plan B.
    You can configure such backup configurations according to your company policy. e.g. in the pictures below: If an odoo entity is in both configs, it will be backed up according to both configs but no additional backup records will be created if it has been backed up that day, for example odoo entity Ais in the config "backup all" (backup daily and keep the 3 most recent backups). and config "important odoo entities" (backup daily and keep the 30 most recent backups). Then odoo entity A will be backed up daily and keep the 30 most recent backups.
Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.