S3 Offload: move the Odoo filestore to AWS S3, Cloudflare R2 and Backblaze B2
by Aerya IT Solutions https://aerya.net$ 53.69
Odoo 17, 18, 19 and 20, Community and Enterprise · Developed in the European Union by Aerya IT Solutions
S3 Offload: move the Odoo filestore to AWS S3, Cloudflare R2 and Backblaze B2
Move the binaries of your attachments out of the Odoo filestore into a bucket of Amazon S3, Cloudflare R2, Backblaze B2, Wasabi, Garage or any S3-compatible service, without changing a link or an access right. A file leaves the filestore only after its copy in the bucket was verified, and you can move everything back.
Migration with a dry run, a progress bar, pause, and failed files you can retry
Move back to Odoo, verify the bucket, repair from the local copy
No boto3, no other module needed, Odoo 17 to 20
Runs on Odoo.sh and on-premise, not on Odoo Online (SaaS), where Odoo does not allow modules with Python code. Please buy the version that matches your database.
Screenshots of Odoo 17 Enterprise with the data of a fictitious company.
on Odoo 20
no warnings
The problem
The filestore of an Odoo server grows with every attachment: invoices, scans, mail attachments, product images. After a few years it is hundreds of gigabytes on the disk of the server, it makes backups slow and it ties the company to one machine. Putting the files in an object storage bucket is the usual answer, but moving them is a job nobody wants to do twice: a file lost on the way is a lost invoice.
The migration must be safe: nothing leaves the filestore before its copy is checked, a failed file must wait and be retried, and the move must be reversible.
What the module does
It moves the binaries of Odoo attachments out of the filestore into any S3-compatible bucket: Amazon S3, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces, Hetzner, OVH, Scaleway, Garage or SeaweedFS. Odoo keeps the attachment record, the access rights and the links. Only the bytes move. A migration works through the existing files in the background with a progress bar, and new files can move by themselves a few minutes after they are saved. It needs only Odoo's mail, no Python package and no other Aerya module.
How it works, step by step
- Create the bucket and a key. In your storage service create a bucket and an access key allowed to list, read, write and delete in it (s3:ListBucket, s3:GetObject, s3:PutObject, s3:DeleteObject, s3:AbortMultipartUpload).
- Configure the bucket in Odoo. Open Object Storage > Buckets > New: bucket, endpoint (empty for Amazon), region and keys. Test Connection writes, reads and deletes a probe object.
- Dry run. In Object Storage > Migrations > New choose the direction Move files to the bucket and press Dry Run: it counts the files and the megabytes.
- Start. Press Start. A scheduled action works through the files in the background and a progress bar shows how far it got. Failed files wait with growing delays. Failed Files lists them with the reason and a retry button.
- Move new files. Switch on Move New Files on the bucket. Files saved from now on that pass the filters (size from 100 KB by default, field images optional) move a few minutes after they are saved.
- Move back, or verify. A migration can also move files back to Odoo, checking each file against its checksum first, or verify the bucket: missing or damaged objects are repaired from the local copy while it exists.
A worked example
A company has 180 GB of attachments in the filestore. The administrator creates a bucket, tests the connection and runs a dry run: 412,000 files. She starts the migration at the end of the day. Overnight the scheduled action copies each file, checks its size and its ETag against the MD5 of the file, and releases the local file to Odoo's filestore cleanup three days later, only if the copy in the bucket still checks out. Nineteen files fail because they were locked: they wait and are retried, and the list shows the reason. From then on, new files move by themselves, and the server's disk stops growing.
Safety rules
- A file leaves the filestore only after its copy in the bucket was verified: size, the ETag against the MD5 of the file, and optionally a full download compared with the SHA-1 of the attachment. The local file must match the checksum of the attachment before it is sent.
- The local file is not deleted at once. It is released to Odoo's own filestore cleanup after Keep Local Copy days (3 by default) and only if the bucket copy still checks out. If the bucket lost it, the file is uploaded again from the local copy.
- A reading error is an error, never an empty file: while the bucket is unreachable a read raises, instead of returning nothing that could be saved back.
- Bucket objects are deleted only when nothing uses them any more, after a delay (7 days by default). Shared content, with the same checksum, is stored once.
- Uninstalling is refused while attachments are in a bucket: move them back first.
- A copy of the database is neutralized: automatic move off, pending deletions dropped, secret keys blanked, running migrations paused.
Features
A migration with progress
A dry run first, then a progress bar, pause and resume, and failed files you can retry.

The bucket and its rules
Endpoint, region, keys, the size filter and the way files are served: Odoo reads the file and sends it (the default), or redirects to a signed link valid 5 minutes. Images always go through Odoo, which resizes them.

Files that could not move
Each failed file with the reason and a retry button.

The list of migrations
Every migration, in either direction, with its state.

Cleanup with a delay
Objects wait for their delay before they are deleted from the bucket, so the bucket keeps a copy while you check.

The files held by the bucket
Every attachment stored in a bucket.

The log
What the module did, file by file.

Settings and options
| Bucket, endpoint, region, keys | Endpoint empty for Amazon. Test Connection writes, reads and deletes a probe. |
| Move New Files | Files saved later move a few minutes after they are saved. |
| Size filter | From 100 KB by default. Field images are optional. |
| Keep Local Copy | Days before the local file is released (3 by default). |
| Bucket cleanup delay | 7 days by default. Give the bucket versioning or a backup of its own. |
| Serving | Odoo reads and sends the file, or redirects to a signed link valid 5 minutes. |
| Large files | Above 64 MB, by multipart upload in 16 MB parts. |
What it does not do
- Attachments kept in the database (location db): the migration refuses and says how to switch.
- The web asset bundles, URL attachments and the attachments of views are never moved.
- Client-side encryption and SSE-C, bucket lifecycle and replication (create them in the service), and a CDN in front of the bucket.
- Very large files are read whole into memory when served by Odoo or moved back. Add a bucket lifecycle rule that aborts incomplete multipart uploads after 7 days.
- The tests ran against a self-hosted S3 server (Garage 2.1). They have not run against Backblaze B2 or Cloudflare R2.
Requirements
| Odoo versions | 17, 18, 19 and 20 |
| Editions | Community and Enterprise |
| Odoo apps | Discuss (mail) |
| Modules of ours | None. No Python package. |
| Languages | English, Spanish and Romanian |
Questions
Can I go back to the filestore?
Yes. A migration moves the files back to Odoo, checking each one against its checksum first. The bucket copies stay or are cleaned up, as you choose.
What if the bucket is unreachable?
A read raises an error. It never returns an empty file.
Do I need CORS rules?
No.
Which services work?
Any service that speaks the S3 API: Amazon S3, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces, Hetzner, OVH, Scaleway, Garage, SeaweedFS.
Can two databases use the same bucket?
Not at the same prefix. Use {db} in the prefix.
Explore our other apps
More modules by Aerya IT Solutions for Odoo 20, built to work together.
Questions or a custom quote?
Write to info@aerya.ro for questions about the module, its installation or custom development.
Aerya IT Solutions · Developed in the European Union · aerya.net
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 2208 |
| Technical Name |
aerya_cloud_offload |
| License | OPL-1 |
| Website | https://aerya.net |
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