Skip to main content

Store backups using some FSSPEC implementation

Project description

Odoo Community Association

Auto Backup Fs File

Alpha License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

This module enhances the database backup functionality in Odoo by introducing support for storing backups as files using the fsspec library. It is designed to address the need for reliable and flexible backup solutions, enabling businesses to safeguard their data by storing backups on various filesystems, including cloud storage providers, network drives, and local secure storage.

By integrating with the fs_file addon from the OCA storage repository, this module allows users to automate the backup process and store the resulting files in a configured filesystem. It provides an easy-to-use interface for configuring backup methods, managing stored backups, and ensuring data integrity for disaster recovery or multi-environment setups.

Table of contents

Use Cases / Context

BUSINESS NEED: This module addresses the critical need for safeguarding Odoo instance data by enabling automated backups to a filesystem supported by the fsspec library. Businesses often require reliable and accessible backup solutions to ensure data integrity and recovery in case of system failures or data loss. This module is particularly useful in contexts where organizations need to store backups on cloud storage, network drives, or other custom filesystems supported by fsspec.

Practical examples include:

  • Backing up Odoo data to cloud storage providers like AWS S3, Google Cloud Storage, or Azure Blob Storage.

  • Storing backups on a secure local or remote filesystem for disaster recovery purposes.

  • Automating backup processes in multi-environment setups, such as multi-company or multi-website configurations.

APPROACH: The module extends the backup functionality from the auto_backup module by introducing a method that allows storing the resulting backup using an fsspec implementation. This is achieved through the integration of the fs_file from storage repository. The module leverages the fsspec library to provide a flexible and extensible interface for interacting with various filesystems. It automates the backup process by exporting Odoo instance data and storing it in the specified filesystem. Additionally, it allows users to download the backups for local storage or further processing.

USEFUL INFORMATION:

  • Dependencies: This module depends on the fsspec library, its relevant filesystem implementations, and the fs_file addon from OCA/storage. Ensure the required fsspec plugins are installed for your target filesystem.

Installation

This addon itself does not introduce any dependencies, but its dependencies may require additional packages.:wa

Configuration

  1. Review Documentation for Dependencies Before configuring the module, ensure you have reviewed the documentation for the following modules:

  • fs_attachment

  • fs_storage These modules provide the necessary setup for file storage and attachment handling.

  1. Configure File Storage

  • Navigate to Settings > Technical > FS Storage.

  • Create or select an existing storage configuration.

  • Ensure the storage is properly set up and tested for accessibility.

  1. Link Backup File field to Storage

  • While configuring the file storage in Settings > Technical > FS Storage, ensure that the backup_file from the db.backup.fs.file model is listed under the Field field.

  • This step is part of the storage configuration process.

  • Save the changes after verifying the setup.

Example of File Storage Configuration

  1. Verify Configuration

  • Perform a test backup to ensure the files are being stored in the correct location.

  • Check the logs for any errors or warnings.

By following these steps, you will ensure that the module is properly configured for storing backups in the desired file storage system.

Usage

This module extends the functionality of the database backup system in Odoo by introducing a new backup method: Fs File. This method allows storing database backups as files using an FSSPEC implementation.

How to Use the Module

1. Configure the Backup Method
  1. Navigate to Settings > Technical > Database Structure > Automated Backups.

  2. Create or edit a backup configuration.

  3. In the Backup Method field, select Fs File.

  4. Configure other fields as needed, such as the backup format and retention settings.

  5. Save the configuration.

2. Perform a Backup
  1. From the list of backup configurations, select the one configured with the Fs File method.

  2. Click the Backup Now button to initiate the backup process.

  3. The backup will be stored as a file in the configured FSSPEC storage.

3. View Fs File Backups
  1. Open the backup configuration form view.

  2. In the top-right corner, you will see a Backups stat button (if backups exist).

  3. Click the Backups button to view the list of Fs File backups associated with the configuration.

4. Manage Fs File Backups
  • In the Fs File backups list view, you can see details such as the backup filename and associated database backup configuration.

  • Use this view to manage or download backups as needed.

Screenshots
  • Backup Configuration Form View Backup Configuration Form

  • Fs File Backups List View Fs File Backups List

Notes
  • Ensure that the FSSPEC storage is properly configured before using the Fs File method.

  • This module adds a new stat button in the backup configuration form view to quickly access Fs File backups.

Known issues / Roadmap

  • Folder field behavior: The folder field on the db.backup model specifies the backup storage directory. For records using the fs_file method, storage is actually controlled by the fs_file field’s settings. However, since folder is currently a required non-computed field in the auto_backup addon, modifications to sync these two fields are not performed. Future versions may add this synchronization support.

  • Design limitation: The current implementation has a design constraint due to fs_storage addon limitations. Since storage setting targets the db.backup.fs.file model, only one storage backend can effectively be used.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Binhex

Contributors

Other credits

The development of this module has been financially supported by:

  • Binhex

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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.

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo_addon_auto_backup_fs_file-17.0.1.0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_auto_backup_fs_file-17.0.1.0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2dca3fe5b78fde55add166d0783843f24b3872cd4813a9807898411353103188
MD5 408e14a1d8e3cfc3d0ce9857567ea00c
BLAKE2b-256 209e52b3b857a0d217b3e774a29eeddb525d339cb1e0dbbd3a5df0fd5c4df2c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page