backup
Need Help with Backing Up and Restoring Local Supabase Storage Files (File Backend) to Avoid Missing xattrs
Hi! I'm self-hosting Supabase (Docker,
storage-api:v1.23.0
, file backend) and can't restore local storage files to staging without losing xattrs, causing ENODATA
errors when accessing images in Studio.
Setup:
- Local: Storage at /mnt/stub/stub
. Files have xattrs (user.supabase.content-type="image/jpeg"
, user.supabase.cache-control="no-cache"
) via getfattr
. Images work in Studio.
- Staging: Storage at /var/lib/storage/stub/stub
. Restored files show e
in lsattr
but no user.supabase.*
xattrs, causing errors. storage.objects
entries are identical.
- Backup: Used tar -czf
(Alpine, no --xattrs
) and docker cp
, extracted on staging with tar --xattrs
(Ubuntu container). Also restored DB with pg_dump
.
- Issue: Restored files lack xattrs; new uploads via Studio/Python script work fine.
Logs (staging):
Question: How do I backup/restore storage files to preserve user.supabase.*
xattrs? Should I use rsync -aAX
, GNU tar --xattrs-include='user.supabase.*'
, or something else? Any tips for syncing storage.objects
with files? Sample scripts appreciated!
Thanks!1 Reply
have you tried this script? https://supabase.com/docs/guides/platform/migrating-within-supabase/backup-restore#migrate-storage-objects