Blog
Apr 20, 2025 - 2 MIN READ
How to Properly Backup Your Odoo Instance (Database + Filestore)

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

Back up both the PostgreSQL database and Odoo filestore to preserve business records and uploaded files.

Koderstory

Koderstory

Regular backups help protect an Odoo system from data loss, corruption, and accidental deletion. A complete backup needs both the PostgreSQL database and the filestore where Odoo keeps attachments and assets.

What needs to be backed up?

The PostgreSQL database contains structured information such as records, module data, settings, products, and transactions. The filestore contains binary files, including document attachments, images, reports, and files uploaded by users. Restoring only the database can leave broken links or missing attachments.

Back up the database

Use pg_dump to export the database. Replace the example name with the database you actually use:

pg_dump odoo_db_name > odoo_backup.sql

Back up the filestore

The filestore is commonly found at ~/.local/share/Odoo/filestore/<database-name> or, for a service installation, at /var/lib/odoo/.local/share/Odoo/filestore/<database-name>. Copy the entire database-specific directory and store it alongside the SQL backup.

A dated folder makes the matching pieces clear:

/backups/
└── 2025-04-20/
    ├── odoo_backup.sql
    └── filestore/

For active systems, daily backups are a useful starting point. Automate the process where possible, and periodically restore a backup on a staging server. A backup is only dependable when both parts are present and the restore has been tested.

Originally published on Koderstory Devlog.