Skip to Content
Menu

Filestore Replicator

by
Odoo

99.52

v 17.0 Third Party 6
Availability
Odoo Online
Odoo.sh
On Premise
Community Apps Dependencies
Lines of code 371
Technical Name dkn_filestore
LicenseOPL-1
Websitehttps://dakon.io
Versions 14.0 15.0 16.0 17.0 18.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Community Apps Dependencies
Lines of code 371
Technical Name dkn_filestore
LicenseOPL-1
Websitehttps://dakon.io
Versions 14.0 15.0 16.0 17.0 18.0

Filestore Replicator

Version: 17.0.1.0

Author: Dakon

Compatibility: Odoo 14+


Overview

To set up high availability for Odoo, it is typically necessary to run it on at least two servers. To synchronize the filestore between both servers, NFS (Network File System) is usually required; however, NFS can be quite costly. With this module, all the filestore will be transferred to object storage solutions like Amazon S3 and Google Cloud Storage. By using object storage, you can significantly reduce your infrastructure costs.



Features

  • Mirrors the attachments to Object Storage (eg. S3, Google Cloud Storage, Minio, etc)
  • Storing files in cache to reduce slow network latency.
  • Support for both versions: community and enterprise versions.

Installation

Instructions on how to install the module:

1. Copy the module into your Odoo addons folder.
2. Update the configuration files or use the environment variable.
3. Install the Python dependency detailed in the requirements.txt using the command bellow
   pip install -r requirements.txt
4. Restart the Odoo server.
5. Install module dkn_filestore from menu Apps.

Configuration

There are two ways to configure this module: the first is by using the odoo.conf configuration file, and the second is to set it up using environment variables.

1. Using odoo.conf

[options]
..
dkn_filestore_driver = gs
gs_access_key_id = xxxxxxxxxx
gs_secret_key = xxxxxxxxxx
gs_bucket = odoo
gs_endpoint_url = https://storage.googleapis.com
gs_region = asia-southeast1
..

2. Using environment variable

--------------------------------------------------------------
|                   Primary Configuration                    |
|------------------------------------------------------------|
| VARIABLE              | DESCRIPTION       |  IS MANDATORY  |
|-----------------------|-------------------|----------------|
| DKN_FILESTORE_DRIVER  | driver (s3|gs)    |      TRUE      |
|------------------------------------------------------------|

--------------------------------------------------------------
|             Google Cloud Storage Configuration             |
--------------------------------------------------------------
| VARIABLE              | DESCRIPTION       |  IS MANDATORY  |
|-----------------------|-------------------|----------------|
| GS_ACCESS_KEY_ID      | gs access key id  |      FALSE     |
| GS_SECRET_KEY         | gs secret key     |      FALSE     |
| GS_BUCKET             | gs bucket name    |      FALSE     |
| GS_ENDPOINT_URL       | gs endpoint url   |      FALSE     |
| GS_REGION             | gs region         |      FALSE     |
--------------------------------------------------------------

--------------------------------------------------------------
|                    AWS S3 Configuration                    |
--------------------------------------------------------------
| VARIABLE              | DESCRIPTION       |  IS MANDATORY  |
|-----------------------|-------------------|----------------|
| S3_ACCESS_KEY_ID      | s3 access key id  |      FALSE     |
| S3_SECRET_KEY         | s3 secret key     |      FALSE     |
| S3_BUCKET             | s3 bucket name    |      FALSE     |
| S3_ENDPOINT_URL       | s3 endpoint url   |      FALSE     |
| S3_REGION             | s3 region         |      FALSE     |
--------------------------------------------------------------

Synchronization

After installing this module, you need to sync the old filestore, which contains files not synced to the mirror storage. Go to Settings > Integration > Filestore Mirroring, and click the Sync Filestore button.


Development Mode

1. Setup Development Environment

There are several ways to run this module locally for development, as it requires integrating multiple dependencies. We propose using the docker-compose tools to streamline the installation of the entire stack. This is just an example of docker-compose.yaml, you can improve if needed.

services:

  db:
    image: postgres
    container_name: db
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - db-data:/var/lib/postgresql/data/pgdata

  minio:
    image: minio/minio
    container_name: minio
    ports:
      - "9000:9000" # Minio Service
      - "9001:9001" # Minio UI
    environment:
      - MINIO_ROOT_USER=minio
      - MINIO_ROOT_PASSWORD=minio_secret
      - MINIO_ALIAS=minio_host
      - MINIO_ACCESS_KEY=minio-access-key
      - MINIO_SECRET_KEY=minio-secret-key
      - MINIO_BUCKET_NAME=odoo
    volumes:
      - minio-data:/data
    command: server --console-address ":9001" /data

  minio-mc:
    image: minio/mc
    container_name: minio-mc
    depends_on:
      - minio
    entrypoint: >
      /usr/bin/sh -c "
      /usr/bin/mc alias set $MINIO_ALIAS http://minio:9000 $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD;
      /usr/bin/mc admin user svcacct info $MINIO_ALIAS $MINIO_ACCESS_KEY;
      if [ $? -eq 0 ];
      then
        exit 0
      fi;
      /usr/bin/mc admin user svcacct add --access-key $MINIO_ACCESS_KEY  --secret-key $MINIO_SECRET_KEY $MINIO_ALIAS $MINIO_ROOT_USER;
      /usr/bin/mc mb $MINIO_ALIAS/$MINIO_BUCKET_NAME;
      exit 0;
      "
    environment:
      - MINIO_ROOT_USER=minio
      - MINIO_ROOT_PASSWORD=minio_secret
      - MINIO_ALIAS=minio_host
      - MINIO_ACCESS_KEY=minio-access-key
      - MINIO_SECRET_KEY=minio-secret-key
      - MINIO_BUCKET_NAME=odoo

  odoo:
    image: dakonio/odoo:17.0
    container_name: odoo
    ports:
      - "80:8080"       # Odoo UI (http://localhost)
    environment:
      - OPTIONS__DB_HOST=db
      - OPTIONS__DB_PORT=5432
      - OPTIONS__DB_USER=odoo
      - OPTIONS__DB_NAME=odoo
      - OPTIONS__DB_PASSWORD=odoo
      - OPTIONS__LOG_HANDLER=:INFO
      - OPTIONS__LOG_LEVEL=info
      - OPTIONS__DKN_FILESTORE_DRIVER=gs
      - OPTIONS__GS_ACCESS_KEY_ID=minio-access-key
      - OPTIONS__GS_SECRET_KEY=minio-secret-key
      - OPTIONS__GS_BUCKET=odoo
      - OPTIONS__GS_ENDPOINT_URL=http://minio:9000
      - OPTIONS__GS_REGION=asia-southeast1
    volumes:
      - ./addons/dkn_filestore:/mnt/addons/dkn_filestore:ro
    tty: true
    depends_on:
      - db
      - minio
      - minio-mc
    platform: linux/amd64

volumes:
  db-data:
    driver: local
  minio-data:
    driver: local

2. Check the mirrored file through the Minio console

Open the Minio console at http://localhost:9001, enter the username and password, and then navigate to /bucket_name/filestore/your_db_name.

Tracing update res.partner


Support

For support, please contact:

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.