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

koderstorykoderstory
2 min read

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:

  1. PostgreSQL Database (.sql backup)
    This contains all structured data β€” records, modules, user settings, products, transactions, etc.

  2. 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.


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.

0
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.