Odoo backup and restore: what a self-hosted backup must capture
A usable Odoo backup holds two things taken at the same consistent point: the PostgreSQL database and the filestore. The database holds records, configuration, users and most business data, while the filestore holds binary attachments such as documents, images and generated files under the data directory. A dump of the database without the filestore restores a system whose attachments are broken links, and a filestore copy without a matching database dump restores files that no record points to. Both halves must come from the same moment, so the design starts by treating them as one backup set.
The design matters most for production databases with real users, custom modules and heavy attachment use. Custom modules add schema and configuration that must match the code version that created the backup, so the restore target needs the same module code. The Community and Enterprise editions share the same data layout, so the capture design is identical for both. What differs is how you obtain code and upgrades, not how the database and filestore are stored. Confirm the exact data_dir path and the database name on each server, and record the Odoo version, module source and configuration file (odoo.conf) alongside the backup, because a dump alone does not tell a restore team how to run it.
Before choosing tools, the team should confirm three points with its own environment: which host holds the filestore, whether any attachments are stored outside the default location, and how long a restore is expected to take on the hardware available. A restore test against a copy of the backup set is the only evidence that the set is complete. The sibling pages on staging copies and neutralized databases cover how to use a restore for testing without exposing live data, and the upgrade pages cover what happens when a backup is restored onto a newer version.
Which parts of an Odoo installation need a backup
An Odoo installation is more than one database. Records, attachments, configuration, custom code and licensing each live in a different place, and each can fail or go missing on its own. A backup design is only complete when every one of these parts is covered and can be restored together.
PostgreSQL database
The database holds the business records: partners, sales orders, journal entries, stock moves and user accounts. Back it up with pg_dump on a schedule that matches how much data the business can afford to re-enter. A dump taken without the matching filestore is not a complete copy, because records point to attachments that live outside the database.
Filestore under data_dir
Attachments, binary fields, images and generated documents are stored as files in the filestore directory under data_dir, not inside PostgreSQL. A database restore without this directory leaves broken attachments and missing product images. Back it up with the same run as the database so both halves describe the same point in time.
Configuration file
The odoo.conf file sets database connection details, the data_dir path, worker counts, addons paths and the admin password hash. Without it, a rebuilt server may point at the wrong database or filestore, or run with settings nobody remembers choosing. Keep a copy under version control or in the backup set, and store the secrets it contains with the same care as the backups themselves.
Custom addons and code
Custom modules and third-party addons live in the server's addons paths and are not restored by a database dump. Keep them in a Git repository with tagged releases that match each production version. Confirm that the exact commit deployed to production can be rebuilt, because a database restored against different module code can fail at startup or corrupt data.
Enterprise subscription and activation
Enterprise databases are activated with the subscription code, so the code and the subscription record are needed to rebuild the same edition on new hardware. Record the subscription details and where they are held, separately from the server. Confirm with Odoo how a lost activation is handled before you depend on a restored system.
On-premise docsOff-server copies and encryption keys
Backups stored only on the Odoo server disappear with that server. Plan at least one copy outside the Odoo host's failure domain, and keep the keys used for encryption in a place the backup operator can reach during a recovery. A copy that cannot be decrypted or reached during an incident is not a backup in practice.
Backup methods and when each fits
This table compares four ways to copy a self-hosted Odoo installation: pg_dump, volume snapshots, PostgreSQL base backups with WAL archiving, and the web database manager. Read each row to see how consistent the copy is, how much work a restore takes, and whether the method suits a large database. The main takeaway is that a complete Odoo backup needs the database and the filestore captured together, and most methods only cover one of them without extra work.
| Method | Consistency and what it covers | Restore effort and large database fit |
|---|---|---|
| pg_dump (logical dump) | Consistent snapshot of the database at dump time. Does not include the filestore in data_dir, so attachments must be copied separately. | Restore by loading the dump into a new PostgreSQL database, then restoring the filestore. Suited to small and medium databases; check dump and load times on your own data. |
| Filesystem or volume snapshot | Consistent only if PostgreSQL and the filestore are captured at the same point, which usually needs a quiesced or crash-consistent snapshot. Can cover the data directory and filestore together. | Fast to take on supporting storage, but restore depends on the platform and the snapshot procedure. Test a full restore on the same storage type before relying on it. |
| PostgreSQL base backup with WAL archiving | Supports point-in-time recovery to a chosen moment. Covers the database cluster only, so the filestore still needs its own copy. | Most restore steps to learn and run. Designed for large and busy databases, but requires careful archive management and regular restore drills. |
| Web database manager (backup from the browser) | Produces a dump through the Odoo interface. Depends on the Odoo server handling the request, so it is tied to the application's health and timeouts. | Simple for small databases. Not a backup tool for large databases: long requests can time out, and the output does not replace an off-site copy of the filestore. |
| What to test | Confirm the restored database opens, attachments display, and scheduled actions and users behave as expected. | Ask for a timed restore to a separate host and record the result. Do not rely on backup size or duration figures until you have measured them on your data. |
How to set up a pg_dump and filestore backup job
This sequence produces a matched pair of artifacts for each run: a PostgreSQL dump and a copy of the Odoo filestore taken with the same timestamp, verified by checksums and recorded in a log. Together they give you a restore point you can test.
Confirm data_dir and database names
Start by reading the
data_dirvalue from the Odoo configuration file (commonlyodoo.conf) on the server that runs Odoo, and list every database the instance serves with the PostgreSQL client. Record the filestore path for each database, which sits underdata_dirin a directory named after the database. Your infrastructure or platform engineer should own this step. It is done when you have a written inventory of database names, their filestore paths and the account that runs Odoo, because a backup that misses one database or one filestore is incomplete.Run a consistent pg_dump in custom format
Run
pg_dumpagainst each database with the custom format flag, which produces a compressed archive thatpg_restorecan read selectively. Run it as the PostgreSQL role that has read access to the database, and write the output to a dated file name such asdbname_YYYYMMDD-HHMMSS.dump. The dump is taken from a single snapshot, so it is internally consistent even while users are working. Check the exit code and confirm the file is non-empty before you move to the next step.Archive the filestore with the same timestamp
Archive the filestore directory for the same database into a compressed tar file that uses the same timestamp as the dump. Attachments, uploaded documents and generated reports live in the filestore, not in PostgreSQL, so a dump alone cannot restore them. Pairing the two files by name makes it clear which filestore belongs with which dump. Note that a filestore copied while users upload files can capture a partial write, so schedule the job for a quiet window or confirm the risk with your team before you rely on it.
Write checksums for both artifacts
Generate a SHA-256 checksum for the dump and for the filestore archive, and store them in a checksum file next to the artifacts, such as
dbname_YYYYMMDD-HHMMSS.sha256. Checksums let you prove later that a copy moved off-site or restored from storage has not changed. Your security or operations team should decide where the checksum file is kept, since a checksum stored beside the only copy of the data does not protect against tampering with both. The step is done when a checksum verification command passes on the files as written.Schedule the job outside Odoo's worker processes
Run the backup from the operating system scheduler, such as
cronor a systemd timer, under a dedicated service account, rather than through an Odoo scheduled action. Odoo's cron workers are subject to worker limits and time limits, and a long dump can be interrupted or delayed by them. Keep the schedule outside the Odoo process so a stuck worker does not stop backups. Set the job to write its output to a known directory and to fail loudly on any non-zero exit code. Confirm the schedule with your platform team, including how it behaves during maintenance windows.Log each run and verify both artifacts
Have the script append a log entry for every run that records the start and end time, the database names, the artifact file names, their sizes and the checksum results, and the exit status. Alert on any failed run and on any run that produces only one of the two artifacts. Review a sample run by checking that the dump lists its contents with
pg_restore --listand that the filestore archive extracts cleanly. The step is complete when a run is confirmed to produce both artifacts plus a log line, and the team knows where to look when it does not.
How the database, filestore and off-site copies fit together
The flow starts on the production side, where Odoo serves users from its application server and PostgreSQL holds the database, while attachments live in the filestore under data_dir. A backup host takes a pg_dump of the database and archives the filestore, then encrypts both before they leave. The key hand-off is the copy into storage the Odoo server cannot reach, so a compromise of the application does not also delete the backups. Check that the restore test environment can rebuild the database and filestore together, because a dump without its matching filestore produces broken attachments.
Production data, backup host, off-site copy and restore test, with the trust boundary around the copy.
Schedules, retention and copies the Odoo server cannot reach
The schedule matters less than what the schedule can reach. A nightly dump kept on the Odoo host protects against a failed upgrade or a bad data load, but it does not protect against someone who gets root or database credentials on that host, because the same attacker can delete the backups too. Plan at least one copy that the Odoo server cannot write to or delete from, and that uses storage credentials, encryption keys and administrative accounts separate from the production host. Confirm with your storage provider which immutability or object lock features it offers, how long they hold, and who can override them, since those settings are what stop a ransomware encryption run or a mistaken purge from reaching the off-site copy.
Set two retention tiers. Keep daily copies of the database dump and filestore for a short window that covers the time it usually takes to notice a problem, then keep a smaller set of longer-term copies, such as one per month, for audit questions and for restores that need data from before a change was made. Store the database dump and the filestore archive together under the same timestamp so each restore point is complete, and keep the dbname and data_dir values recorded alongside them. Match retention to your own legal and contractual obligations, which your compliance team should confirm before the schedule is set.
Protect the copies with keys held apart from the production system. Encrypt backups with a key or key pair that the Odoo host cannot read, and store the key in a separate secrets system with its own access review. Use a backup writer account that can only upload new objects, and a separate administrator account that is required to delete or change retention. Replication to a second site can spread a deletion or encrypted file within minutes, so check whether the off-site target keeps versioned or locked objects. Test the setup with a deliberately deleted test object and a restore from the off-site copy, then record how long the recovery took.
Protecting backups from exposure and tampering
A backup is a full copy of your Odoo data, so it carries the same personal and financial records as production and often sits in places with weaker controls. The cards below cover the controls that keep those copies unreadable to outsiders, usable only by the right people, and impossible to quietly alter.
Encrypt dumps and filestore at rest
A pg_dump file and the filestore archive both contain customer names, bank details, invoices and employee records in readable form. Encrypt every archive before it leaves the Odoo server, using a key held outside the backup storage, and record which key version encrypted each set. Confirm with your storage provider whether server-side encryption is enabled and who holds the keys, because an encrypted bucket whose keys sit beside it protects little.
Encrypt transfers to off-site storage
Copies travel from the Odoo host to a backup server, object store or second site, and each hop is an exposure point. Use TLS for every upload and restrict the target to the specific endpoints your backup job needs. Check that the transfer tool verifies server certificates rather than accepting any certificate, since a silent failure there can route backups to the wrong host.
Treat dump files as production data
Restricting access to the production database does not cover a dump sitting in a shared folder or a developer's download directory. Limit read access to the backup service account and a small named group of restore operators, and keep dumps off workstations. Because a database copy made for testing usually still holds live personal data, route test copies through neutralization before anyone outside operations opens them.
Protect the master password
The database manager's master password (admin_passwd in the configuration file) can create, drop and duplicate databases. Anyone who holds it can also obtain a full copy of every database on the server. Store it in a secrets manager, keep it out of the configuration file in version control, rotate it when staff change, and confirm the database manager is disabled or restricted in production, as covered in the security hardening guidance.
Separate backup credentials from production
The account that writes backups should not be the account that runs the Odoo application or the one that owns the database. Give the backup job a PostgreSQL role with read access for dumping and no rights to alter data, and use a separate storage credential that can only write new objects, not delete old ones. If the production host is compromised, the attacker should not gain the ability to erase or overwrite the copies.
Keep write-once copies
A backup that ransomware or an insider can delete is not a recovery point. Store at least one copy in object storage with object lock or versioning that blocks deletion before the retention period ends, or on media that is physically write-once. Confirm the exact lock mode and retention behavior with your provider and test that a delete request is refused, since configuration defaults vary.
Log every download and restore
Record who fetched a backup, who started a restore, which set was used, and where the data went. Keep these logs in a location the backup operators cannot edit, and review them on a schedule. Ask your storage provider which access and object-level events it can export, and confirm that the restore procedure itself writes a ticket or log entry with a named approver.
Questions buyers ask about Odoo backup and restore
What drives the cost and effort of an Odoo backup design?
The cost depends on how many environments need protection, how large the database and filestore are, how long you keep copies, and where the copies must live. A design covers the pg_dump schedule, the filestore in data_dir, retention rules, encryption, off-site transfer, monitoring of backup jobs and a documented restore procedure. Most of the one-time effort is the design and the first restore test. The recurring part is storage, monitoring and periodic restore tests. Ask any quote to separate one-time build work from ongoing storage and testing, and to state which environments and retention periods it covers. DeployOpen does not publish prices, so the written scope sets the figure.
How long does an Odoo restore test take?
The duration depends on the size of the database, the size of the filestore, the speed of the storage the copy is read from, the hardware of the restore target and whether the restored copy is then started and checked. A restore test has to rebuild the database and the filestore together, start the Odoo server against them and confirm that key screens, attachments and scheduled actions behave. Ask for the measured restore time from a test on a copy of your own data, not an estimate. Repeat the test whenever the database grows materially or the hosting changes.
What does the internal team need to provide for a backup project?
The team needs administrative access to the servers or containers that run Odoo and PostgreSQL, read access to the data_dir path that holds the filestore, and credentials for the database role that performs the dump. It also needs a storage target that the Odoo server cannot write to or delete from, such as a separate account or a repository with append-only rules, and a named owner for retention decisions. Written retention rules should state how long daily, weekly and monthly copies are kept, who may restore, and which regulations or contracts set those periods. Confirm these items before the scope is agreed.
Can an internal team run Odoo backups and restore tests on its own?
Yes, many teams do, provided they have Linux administration skills, PostgreSQL experience and a process for checking results. The work that usually gets skipped is the restore test. A backup that has never been restored is not yet proven. Internal teams should decide who runs the restore test, how often, on which hardware, and where the evidence is kept. A partner can design the schedule, build the jobs, run the first restore and hand over a runbook, or it can run the recurring tests as part of a retainer. Choose the split in writing so nobody assumes the other party is checking the copies.
How do backups relate to Odoo upgrades and staging copies?
A backup taken before an upgrade is the rollback point if the upgrade fails, so it should be verified before the upgrade window opens. Odoo's upgrade documentation describes moving a database to a newer supported version through an upgraded test database that should be tested before production. Staging copies are a different tool: they are built for testing and training and are usually neutralized, which means outgoing email, payment and integration settings are switched off. Do not restore a production backup straight into a live environment for testing. Keep staging refreshes and backup restores as separate procedures with separate checks.
What should we confirm about Enterprise activation and support during a restore?
Confirm the Odoo edition, the subscription status and the support plan before you rely on a restore. Odoo's on-premise documentation says Enterprise databases are activated by entering the subscription code, so a restored Enterprise database must have a valid subscription behind it. Odoo's standard support covers the first three years after a major release, including security updates, and extended support is limited to Odoo.sh for select versions and on-premise. Security patches come only during standard support. Confirm with Odoo which version and support window applies to your installation, and confirm whether a restore into a new host needs any activation step.
Why is the Odoo database manager not enough for large backups?
The web database manager is convenient for small databases, but it is not designed as a managed backup system for large databases. It depends on the Odoo web application being reachable and healthy, and it produces a single archive that has to be stored, copied and tested by someone. Large databases can take long enough to back up that a web request is a poor fit. A scheduled pg_dump run from the database host, paired with a copy of the filestore, gives you consistent scheduling, separate off-site transfer and a restore path that does not depend on the Odoo web tier. Confirm the exact method with your own version and data volume before you rely on it.
Does an Odoo backup design need an off-site copy?
A copy on the same host or in the same data center protects against accidental deletion and some disk failures, but it does not protect against loss of the site. An off-site copy should live where the Odoo server and its administrators cannot change or erase it without a separate approval. The design should state the storage location, the transfer method, how the copy is encrypted, who holds the keys and how long a copy stays available. Where data residency or sector rules apply, confirm the location with your compliance team before choosing a storage provider.
Limits to confirm in your environment before relying on a backup
A backup design for Odoo is only as good as the assumptions behind it. The items below are the limits a team should verify against its own Odoo version, database server, storage and hosting contract before it treats a schedule as protection. Each one changes either what gets captured or how fast a restore can happen.
Odoo version behavior for dumps
Confirm how your exact Odoo version handles database dumps and the filestore, and whether the procedure you plan to use is documented for that release. Behavior around attachments, the filestore path and neutralization can differ between versions, so test a dump and restore on the version you run in production. Also confirm which Odoo release line is in standard support, since that determines whether security patches continue for the instance you are protecting. Standard support for Odoo 17.0 ended in September 2026.
Odoo support docsPostgreSQL version and extensions
Record the PostgreSQL major version, the Odoo database owner and any extensions the database uses. A dump taken with one client version may not restore cleanly on another, and a restore target must provide the same extensions or the restore will fail partway through. Check whether the database server is shared with other applications, because a backup that captures only one database can miss schemas or roles that other services depend on.
Storage capacity for dumps and filestore
Estimate the size of the compressed dump, the uncompressed database and the filestore, then add room for several retained generations and temporary space during backup and restore. Attachments in the filestore often grow faster than the database, and a backup job that fills the disk can stop the Odoo server as well. Confirm that the backup target has enough capacity for the retention period you set and that alerts fire before it runs out.
Recovery point and recovery time targets
Ask the business to state how much data it can lose and how long Odoo can stay down. The recovery point target decides how often dumps run and whether the database and filestore need to be captured together. The recovery time target decides whether a full logical restore is acceptable or whether a standby or replica is needed. Without these two numbers, a schedule is a guess, and the restore test cannot show whether the design meets them.
Hosting provider permissions
Confirm with the hosting provider or data center team that the chosen method is allowed. Some providers restrict direct access to the database port, limit snapshot tooling, or require approval before copying data to another region or account. If the copy leaves the infrastructure you control, check contract, data residency and encryption terms first. Document the answer, because an auditor or the security team will ask how off-site copies are protected.
Restore tests that prove the backup works
A backup that has never been restored is a hypothesis, not evidence. The restore drill is the only way to prove that the pg_dump file and the filestore copy taken from data_dir together produce a working Odoo instance. Run the drill on an isolated host that has no route to production mail, payment or integration endpoints, so a restored system can start without touching live services. Create an empty PostgreSQL database with the same major version and owner role that the source used, restore the dump into it, copy the filestore back to the path Odoo expects, then start the Odoo server against that database. Treat any error during this sequence as a finding about the backup, not about the drill.
Once Odoo starts, the drill should check things a database restore alone cannot show. Log in with a named test account and confirm that the expected companies, users and recent records appear. Compare record counts for the most important models, such as sales orders, invoices, stock moves or employees, against figures taken from production at the moment the backup finished. Open a sample of attachments, product images and PDF reports to confirm that the filestore files resolve, because a missing filestore leaves database rows that point to nothing. Record the date, the backup file names and checksums, the Odoo and PostgreSQL versions, the people involved, and every deviation. Store that record where the operations team and auditors can read it.
Schedule restore tests at a fixed interval that the business agrees to in writing, and run an additional drill after every change that could break restores: a major Odoo version upgrade, a PostgreSQL major version change, a new custom module with its own data files, or a change to data_dir or storage layout. Ask your team or partner to confirm which change triggers apply to your stack and who approves a failed drill. Keep at least one restore test that runs from the off-site copy alone, since a drill that only uses the local backup set does not prove that the remote copy is usable. A failed drill should block the next scheduled change until the cause is understood.
How DeployOpen designs and tests Odoo backups
DeployOpen plans, builds, tests and hands over Odoo backup and restore inside your own infrastructure, covering the PostgreSQL database, the filestore and copies held outside the Odoo server. Engagements are fixed-scope, so the backup design, restore procedure and handover documents are agreed in writing before work starts.
How we scope
- Inventory the Odoo databases, filestore locations, hosting type and where each copy must be kept.
- Agree written recovery targets with your team, including which data loss and downtime your business accepts.
- Confirm who owns off-site storage, encryption keys and access to backup media before any build begins.
How we build
- Configure scheduled database dumps and filestore archives so both are captured from the same point in time.
- Set retention periods and off-site replication in your storage, with access limited to named operators.
- Script restore procedures for a full database, a filestore and a single neutralized test copy.
How we hand over
- Deliver a runbook covering schedules, retention rules, restore steps and the owner of each backup job.
- Run a restore test into a separate environment and record the timings and the checks that passed.
- Walk your operators through a restore drill so they can repeat it without DeployOpen present.
How we support
- Offer ongoing support and periodic restore testing as a retainer, sized to your written scope.
- Review backup job logs and storage capacity with your team on the agreed cadence.
- Retest the restore procedure after Odoo upgrades, PostgreSQL changes or storage migrations.

