cli icon indicating copy to clipboard operation
cli copied to clipboard

Download the latest backup using the supabase CLI

Open kratman opened this issue 8 months ago • 1 comments

Is your feature request related to a problem? Please describe.

I am working on some external backup and recovery tasks for a customer. I am currently using the supabase db dump functionality, however, it would be nicer if I could access the existing backups from the CLI. This would avoid duplicating the existing supabase backup functionality and ensure that backups are identical for the supabase dashboard interface and the fallback/replication backups needed for the project.

Describe the solution you'd like

I would like to have a supbase-cli function to get recent scheduled or PITR backups from a deployed project. Just fetching the most recent would be sufficient for my purposes, but it could also be expanded to let users pick which backup would be downloaded by the CLI

I included a couple examples below.

Fetch latest backup

supabase db backup 

Fetch Nth-previous backup

supabase db backup -n 1

List backups for the linked project

supabase db backup list

Fetch specific backup

supabase db backup -t <name_of_backup_tag_from_list>

kratman avatar Jun 03 '25 01:06 kratman

Hi @kratman, thanks for filing this feature request. We are in the process of moving everyone from logical backups to physical backups. Once the move is completed, we will also downloading physical backups via API.

To avoid adding features that are planned for deprecation, I've only implemented listing and restoring physical backup in cli for now. I will come back to this again when we support downloading physical backups.

npx supabase@beta backups list

sweatybridge avatar Jun 05 '25 08:06 sweatybridge