Skip to content

Export the Odoo filestore from a running environment and upload it to fix a missing or mismatched filestore after a restore.

When to use this ​

After a database restore, Odoo may return 500 errors for pages that load attachments (images, CSS bundles, company logo). This happens when the database references files that are not present in the filestore volume. Common causes:

  • The backup was created before filestore archiving was supported - only the database dump was restored.
  • The database was restored from a different source instance and the filestores were never transferred.

The fix is to export the correct filestore from its original location and upload it via Replace Filestore in the Backups tab.

Export the filestore ​

Odoo stores attachments at /var/lib/odoo/filestore/<subdomain>/ inside the Odoo container, which maps to a named volume. The archive must contain the filestore contents directly - no subdirectory wrapper.

First, find the volume name:

List relevant volumes
bash
docker volume ls | grep <subdomain>

Then export from it using a one-shot container:

Export from volume
bash
docker run --rm \
  -v <odoo-volume>:/odoo_data \
  -v "$(pwd)":/out \
  alpine:3 \
  tar czf /out/filestore.tar.gz -C /odoo_data/filestore/<subdomain> .

Replace <odoo-volume> with the volume name and <subdomain> with the Odoo database name (same as the instance subdomain).

From a directory on disk ​

If the filestore is bind-mounted to a directory on the host rather than a named volume:

Export from directory
bash
tar czf filestore.tar.gz -C /path/to/filestore/<subdomain> .

Note

The -C flag changes into the directory before archiving, so paths inside the archive start with ./ rather than the full path. This is required for the upload to work correctly.

Verify the archive ​

Before uploading, confirm the archive structure is correct:

Check archive contents
bash
tar tzf filestore.tar.gz | head -5
# Expected output (paths start with ./):
# ./
# ./ab/
# ./ab/ab1234…
# ./cd/
# ./cd/cd5678…

Paths must start with ./. If you see filestore/<subdomain>/… at the top level the archive was created from the wrong working directory and the upload will produce an empty filestore.

Upload via the platform ​

  1. Open the instance, go to the Backups tab.
  2. Scroll to Replace Filestore at the bottom of the tab.
  3. Click Upload filestore archive and select filestore.tar.gz.
  4. Status changes to Replacing Filestore - the instance stops briefly then restarts.

Warning

This overwrites the entire filestore. Any files added to the instance after the exported snapshot will be lost.

Troubleshooting ​

ProblemFix
Upload rejectedFile must end in .tar.gz. Max 5 GB.
500 errors persist after replaceVerify archive structure - paths must start with ./, not filestore/…. Re-export with the correct -C flag.
Wrong files after replaceThe subdomain used in the export path must match the instance's database name exactly. Check with tar tzf filestore.tar.gz | head.
Button disabledInstance must be Running or Stopped, and plan must be dev or pro.