Metadata-Version: 2.1
Name: odoo-addon-auto_backup_fs_file
Version: 17.0.1.0.0.3
Requires-Python: >=3.10
Requires-Dist: odoo-addon-auto_backup>=17.0dev,<17.1dev
Requires-Dist: odoo-addon-fs_file>=17.0dev,<17.1dev
Requires-Dist: odoo>=17.0a,<17.1dev
Summary: Store backups using some FSSPEC implementation
Home-page: https://github.com/OCA/server-tools
License: AGPL-3
Author: Binhex,Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 17.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Development Status :: 3 - Alpha
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

===================
Auto Backup Fs File
===================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:ee3d4c88955253f4037b88f12085fc335206fe54512032059d08dddf4c753c51
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
    :target: https://odoo-community.org/page/development-status
    :alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
    :target: https://github.com/OCA/server-tools/tree/17.0/auto_backup_fs_file
    :alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-auto_backup_fs_file
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=17.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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.

.. IMPORTANT::
   This is an alpha version, the data model and design can change at any time without warning.
   Only for development or testing purpose, do not use in production.
   `More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
   :local:

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 <https://github.com/OCA/storage>`__. 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.

2. **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.

3. **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|

4. **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.

.. |Example of File Storage Configuration| image:: https://raw.githubusercontent.com/OCA/server-tools/17.0/auto_backup_fs_file/images/file_storage_configuration.png

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.

.. |Backup Configuration Form| image:: https://raw.githubusercontent.com/OCA/server-tools/17.0/auto_backup_fs_file/static/description/db_backup_form_view.png
.. |Fs File Backups List| image:: https://raw.githubusercontent.com/OCA/server-tools/17.0/auto_backup_fs_file/static/description/db_backup_fs_file_tree_view.png

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 <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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20auto_backup_fs_file%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Binhex

Contributors
------------

- Rolando Pérez Rebollo r.perez@binhex.cloud

Other credits
-------------

The development of this module has been financially supported by:

- Binhex

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

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 <https://github.com/OCA/server-tools/tree/17.0/auto_backup_fs_file>`_ project on GitHub.

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