| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 431 |
| Technical Name |
s3_connector |
| License | OPL-1 |
S3 Connector
S3 Connector allows you to use an S3-compatible storage as the main storage for your Odoo instances.
Store attachments, media files, and static assets in S3 instead of the local filesystem or database, reducing server load and improving scalability. This module is especially useful for production environments, cloud deployments, and multi-instance setups, where local storage is limited or not persistent.
S3 Connector works with AWS S3 and most S3-compatible storage providers, including MinIO, DigitalOcean Spaces, Cloudflare, Backblaze B2, Yandex Cloud Object Storage, and others.
Configuration
Configure the S3 connection using the Odoo configuration file:
;Odoo configuration file
[s3]
endpoint_url=your_url
access_key_id=your_access_key
aws_secret_access_key=your_aws_secret_access
bucket_name=your_bucket_name
Odoo shell commands for setting up S3 as the storage backend:
# Set the storage type to S3
env['ir.attachment'].set_storage("s3")
# Optional: revert storage type to filesystem
env['ir.attachment'].set_storage("file")
Note: Without migrating files, Odoo will not start, as static files will remain in the filesystem. Either recompile static assets or run the migration described in the next section.
Migration
The module also includes migration scripts to safely transfer existing files from the local filesystem to S3.
# Migrate files from filesystem to S3 and set the storage type to S3
env['ir.attachment'].migrate_filesystem_to_s3()
# Optional: revert files back from S3 to filesystem and set the storage type to filesystem
env['ir.attachment'].migrate_s3_to_filesystem()
It is recommended to create a backup before running migration scripts on a production system.
Advanced
The module also provides command-line tools for creating and restoring database dumps with support for S3 or filesystem-based storage.
# Create database dump with filestore.
# Depending on the ir_attachment.location param in the database, files will be retrieved either from S3 or from the filesystem.
utils/db_service.py --path /Path/to/new/dump --config /Path/to/odoo.conf
# Restore dump and store files in S3
utils/db_service.py --restore --db_name new_db_name --config /Path/to/odoo.conf --path /Path/to/dump.zip --storage s3
# Restore dump and store files in filesystem
utils/db_service.py --restore --db_name new_db_name --config /Path/to/odoo.conf --path /Path/to/dump.zip --storage file
# Restore dump with neutralize (set storage type to filesystem)
utils/db_service.py --restore --neutralize --db_name new_db_name --config /Path/to/odoo.conf
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