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.
From a named volume (recommended)
First, find the volume name:
docker volume ls | grep <subdomain>Then export from it using a one-shot container:
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:
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:
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
- Open the instance, go to the Backups tab.
- Scroll to Replace Filestore at the bottom of the tab.
- Click Upload filestore archive and select
filestore.tar.gz. - 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
| Problem | Fix |
|---|---|
| Upload rejected | File must end in .tar.gz. Max 5 GB. |
| 500 errors persist after replace | Verify archive structure - paths must start with ./, not filestore/…. Re-export with the correct -C flag. |
| Wrong files after replace | The subdomain used in the export path must match the instance's database name exactly. Check with tar tzf filestore.tar.gz | head. |
| Button disabled | Instance must be Running or Stopped, and plan must be dev or pro. |