Blog · Storage & performance
Shrink your Odoo database by moving attachments to Google Drive
Every invoice PDF, scanned document, and email attachment your team saves in Odoo grows the database. An Odoo Google Drive integration offloads that file storage to the cloud — so the database stays lean, backups stay fast, and every file is still one click away.
By Arpit — Founder & Owner, KSROlabs · July 2026 · 8 min read
Why your Odoo database keeps getting bigger
Odoo is excellent at running your business, but it was never designed to be a file server. By default, when someone attaches a document to a record — a customer invoice, a signed contract, a product photo, an inbound email attachment — that binary data is stored as an ir.attachment record, which on many deployments means it lands inside the PostgreSQL database itself.
A few files are harmless. But across thousands of sales orders, invoices, and projects, Odoo attachment storage adds up fast. The symptoms are familiar: database backups that take longer every month, restores that crawl, hosting bills that scale with database size, and an Odoo instance that feels heavier than it should. On hosted plans that bill by database size, this bloat is a direct, recurring cost.
The root problem is that operational data (records you query and report on) and file blobs (documents you rarely open) are sharing the same expensive, performance-sensitive storage. They should not.
The fix: offload Odoo attachments to Google Drive
The cleaner approach is to keep the database for what it is good at and push the files somewhere built for cheap, durable file storage. That is exactly what an Odoo cloud storage setup does when you move Odoo attachments to Google Drive: the file lives in Drive, and Odoo keeps only the link. The record still shows the attachment, users still open it with one click, but the heavy bytes are no longer weighing down your Odoo filestore or your PostgreSQL database.
Done manually, this would be tedious and error-prone. Automated, it is invisible: files flow to Drive on save, the database stays lean, and nobody has to think about it. That automation is what the KSROlabs Google Drive Storage Sync module provides.
How the Google Drive Storage Sync module works
The module hooks into Odoo’s standard attachment system, so it works with every record type that supports files — sales orders, invoices, contacts, purchase orders, projects, and custom models. Four things make it practical for real deployments:
- Automatic sync on save. Attach a file to a record and it uploads to Google Drive automatically. No cron configuration, no manual export, no CSV steps.
- Structured folder mapping. Drive mirrors your Odoo hierarchy — a folder per model, a subfolder per record — so files stay organised and findable in Drive as your data grows.
- Retrieve on demand. From inside Odoo, users see the file exists and open it directly in Drive with one click. The Odoo filestore keeps the Google Drive link, not the blob.
- Keep-link-only option. Choose to remove the local Odoo copy after a successful upload to reclaim database space, or keep both copies if you prefer redundancy.
Setting it up — four steps
1. Install the Google Drive Storage Sync module from the Odoo App Store
Install the KSROlabs Google Drive Storage Sync module from the Odoo App Store on your Odoo 16, 17, or 18 instance, Community or Enterprise. The module adds Google Drive storage settings to Odoo without disrupting your existing attachments.
2. Connect Google Drive with a service account
In Google Cloud Console, create a service account, enable the Google Drive API, and download the JSON key. Paste the key and the target Drive folder ID into the module settings in Odoo. No Workspace admin rights are required — the service account only touches the folder you choose.
3. Configure sync and offload rules
Choose whether attachments are uploaded to Google Drive automatically on save, how the Odoo record hierarchy maps to Drive folders, and whether to remove the local Odoo copy after a successful upload to reclaim database space.
4. Migrate existing attachments and verify
Run the one-time bulk migration to move attachments already in Odoo up to Google Drive, then open a record and confirm the file opens from Drive with one click. New attachments sync automatically from then on.
What you gain
Moving attachment storage out of the database has effects that ripple across cost, performance, and day-to-day file access.
📉
Smaller, leaner database
Binary attachments move out of PostgreSQL to Google Drive, so your Odoo database size stops climbing with every invoice PDF and email attachment.
⚡
Faster backups and restores
A lean database dumps and restores in a fraction of the time. Backups finish quickly and your maintenance windows shrink.
💰
Lower storage cost
Google Drive storage is far cheaper per gigabyte than Odoo database storage, especially on hosted plans that bill by database size.
🗂️
Files organised in Drive
The module mirrors your Odoo record hierarchy — model, then record name, then files — so your Drive stays predictable and searchable.
🔁
Accessible from both sides
Open a file straight from the Odoo record with one click, or browse it in Google Drive. The link is kept in Odoo so nothing gets lost.
🔒
Secure by design
A Google Cloud service account limited to one folder handles every transfer over HTTPS, and Odoo record-level security is respected.
A few things to plan for
Large attachment volumes. If you already have gigabytes of historical attachments, run the bulk migration during a quiet window. It uploads everything in one pass, and you control whether local copies are removed as it goes. Once the backlog is cleared, ongoing sync is lightweight because it only handles new files.
Backup strategy before cleanup. When you enable local copy removal, a file lives only in Google Drive. Confirm your Drive backup or retention policy is in place before turning cleanup on, so your single source of truth is protected.
Permissions. The module uses a Google Cloud service account scoped to a single Drive folder, so it never has broad access to your Workspace. Inside Odoo, record-level security still applies — only users allowed to see a record can trigger uploads for it.
Frequently asked questions
Can I move Odoo attachments to Google Drive?
Yes. The KSROlabs Google Drive Storage Sync module uploads Odoo record attachments to Google Drive automatically on save, using a Google Cloud service account. It also includes a bulk migration tool that moves attachments already in your Odoo database up to Drive in one pass, so you can offload historical files as well as new ones.
Does it reduce Odoo database size?
Yes, significantly, when you enable the optional local copy removal. Odoo stores attachments as binary data directly in the PostgreSQL database, which makes the database grow quickly for document-heavy teams. By offloading attachments to Google Drive and removing the local copies, you reduce Odoo database size, cut storage costs, and speed up backups and restores.
Do files stay accessible in Odoo?
Yes. The module keeps a link between each Odoo record and its Drive file, so users can see that a file exists and open it directly in Google Drive with one click from within Odoo. If you choose to keep local copies as well, the file is available both inside Odoo and in Drive — you do not have to leave the ERP to reach your documents.
Does it work with Odoo Online / self-hosted?
The module works with both Odoo Community and Odoo Enterprise on Odoo 16.0 and above, including self-hosted, Odoo.sh, and other managed deployments. Because it uses the standard Odoo attachment infrastructure and a Google Cloud service account, it does not depend on server filesystem access, which makes it well suited to cloud and hosted environments where the filestore is hard to manage directly.
What happens to attachments added before I install the module?
The module includes a bulk migration tool. After installation and configuration, you trigger a one-time migration that uploads all existing Odoo attachments to Google Drive, and you decide whether local copies are kept or removed. Files added after installation sync automatically on save, so both your backlog and your future attachments are covered.
How much does it cost and how do I get it?
The Google Drive Storage Sync module is a paid module available on the Odoo App Store as a one-time purchase. Free setup support is included with every purchase, so we help you connect the service account, configure the offload rules, and run the initial migration for your environment. See the product page or contact us to get started.
What you needGoogle Drive Storage Sync for Odoo
Available on the Odoo App Store for Odoo 16, 17, and 18 — Community and Enterprise. Automatic attachment sync, structured Drive folder mapping, secure service account authentication, a bulk migration tool, and an optional keep-link-only cleanup mode to reduce Odoo database size. Free setup support is included with every purchase.
Ready to reduce your Odoo database size?
We’ll connect Google Drive, configure the offload rules, and migrate your existing attachments. Free setup support included.