π How to Properly Backup Your Odoo Instance (Database + Filestore)


Keeping regular backups of your Odoo system is crucial to avoid data loss, corruption, or accidental deletion. An Odoo backup isnβt complete unless it includes both the PostgreSQL database and the filestore (where attachments and assets are stored).
In this article, weβll walk you through what to back up, why it matters, and the standard practice to ensure your Odoo instance stays safe.
β What Needs to Be Backed Up?
Odoo stores its data in two key places:
PostgreSQL Database (
.sql
backup)
This contains all structured data β records, modules, user settings, products, transactions, etc.Filestore Directory
This contains binary files like document attachments, images, reports, and uploaded files by users.
Both are essential. Restoring only the database without the filestore will result in missing files or broken attachments in your Odoo system.
π‘ Why It Matters
Without proper backups:
You risk losing customer and financial data.
Broken links or missing images/files can impact user experience.
Recovery after a crash or migration becomes difficult or incomplete.
π§ How to Back Up Odoo (the Right Way)
Hereβs the standard backup process:
1. Backup the PostgreSQL Database
You can use pg_dump
to export your Odoo database into a .sql
file:
pg_dump odoo_db_name > odoo_backup.sql
Replace
odoo_db_name
with your actual database name.
This file will contain the full database structure and data.
2. Backup the Filestore Directory
The filestore is typically found under:
~/.local/share/Odoo/filestore/<your-database-name>
Or, if using a custom config:
/var/lib/odoo/.local/share/Odoo/filestore/<your-database-name>
Simply copy this entire directory and store it alongside your SQL backup.
π Recommended Folder Structure
To stay organized, we suggest a backup folder like:
/backups/
βββ 2025-04-20/
βββ odoo_backup.sql
βββ filestore/
π How Often Should You Back Up?
Daily backups are ideal for active systems.
Use automation scripts or cron jobs to streamline this process.
Always test your backups by performing a restore on a staging server.
π Final Thoughts
Backing up Odoo isnβt just about saving the database β itβs about capturing all your critical business data, including attachments and files. Make it a habit. Automate it if you can.
Subscribe to my newsletter
Read articles from koderstory directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

koderstory
koderstory
Koderstory is a lean software company focused on building viable, straightforward products that empower small businesses to grow.