docs: move restoring backup section (#35109)

Before:

Instructions for restoring a backup locally were buried inside the
Upgrading guide.

After:

Instructions for restoring a backup locally are on their own page in the
Local Development section. This page is linked from the Upgrading guide
because it is useful if a paused project has exceeded its restoring time
limit.
This commit is contained in:
Charis authored and Kamil Ogórek committed 2025-04-18 16:58:47 +02:00
1 parent 4a3baa6ab6
commit 1ba8bbef5e
3 files changed
+54 -43

No files matched your search

@@ -1955,6 +1955,10 @@ export const local_development: NavMenuConstant = {
name: 'Managing config and secrets',
url: '/guides/local-development/managing-config',
},
{
name: 'Restoring downloaded backup',
url: '/guides/local-development/restoring-downloaded-backup',
},
{
name: 'Customizing email templates',
url: '/guides/local-development/customizing-email-templates',
@@ -0,0 +1,49 @@
---
title: Restoring a downloaded backup locally
subtitle: Restore a backup of a remote database on a local instance to inspect and extract data
---
You can restore a downloaded backup to a local Supabase instance. This might be useful if your paused project has exceeded its [restoring time limit](/docs/guides/platform/upgrading#time-limits). You can download the latest backup, then load it locally to inspect and extract your data.
<Admonition type="caution">
If you want to restore your backup to a hosted Supabase project, follow the [Migrating within Supabase guide](/docs/guides/platform/migrating-within-supabase) instead.
</Admonition>
## Downloading your backup
First, download your project's backup file from dashboard and identify its backup image version (following the `PG:` prefix):
<Image
zoomable
alt="Project Paused: 90 Days Remaining"
src="/docs/img/guides/platform/paused-dl-image-version.png"
/>
## Restoring your backup
Given Postgres version `15.6.1.115`, start Postgres locally with `db_cluster.backup` being the path to your backup file.
```sh
supabase init
echo '15.6.1.115' > supabase/.temp/postgres-version
supabase db start --from-backup db_cluster.backup
```
Note that the earliest Supabase Postgres version that supports a local restore is `15.1.0.55`. If your hosted project was running on earlier versions, you will likely run into errors during restore. Before submitting any support ticket, make sure you have attached the error logs from `supabase_db_*` docker container.
Once your local database starts up successfully, you can connect using psql to verify that all your data is restored.
```sh
psql 'postgresql://postgres:postgres@localhost:54322/postgres'
```
If you want to use other services like Auth, Storage, and Studio dashboard together with your restored database, restart the local development stack.
```sh
supabase stop
supabase start
```
A Postgres database started with Supabase CLI is not production ready and should not be used outside of local development.
@@ -84,7 +84,7 @@ During the 90-day restore window a paused project can be restored to the platfor
src="/docs/img/guides/platform/paused-90-day.png"
/>
After the 90-day restore window, you can download your project's backup file, and Storage objects from the project dashboard. See [restoring a backup locally](#restoring-a-downloaded-backup-locally) for instructions on how to load that backup locally to recover your data.
After the 90-day restore window, you can download your project's backup file, and Storage objects from the project dashboard. See [restoring a backup locally](/docs/guides/local-development/restoring-downloaded-backup) for instructions on how to load that backup locally to recover your data.
<Image
zoomable
@@ -100,48 +100,6 @@ If you upgrade to a paid plan while your project is paused, any expired one-clic
src="/docs/img/guides/platform/paused-paid-tier.png"
/>
#### Restoring a downloaded backup locally
<Admonition type="caution">
If you want to restore your backup to a hosted Supabase project, you will need to use the
[Migrating within Supabase guide](/docs/guides/platform/migrating-within-supabase)
</Admonition>
If the 90 day project restore window has expired but you need to access data contained within your project using SQL, you can use the [Supabase CLI](/docs/guides/local-development) to restore the project into a local Postgres instance.
First, download your project's backup file from dashboard and identify its backup image version (following the `PG:` prefix):
<Image
zoomable
alt="Project Paused: 90 Days Remaining"
src="/docs/img/guides/platform/paused-dl-image-version.png"
/>
Given Postgres version `15.6.1.115`, start Postgres locally with `db_cluster.backup` being the path to your backup file.
```sh
supabase init
echo '15.6.1.115' > supabase/.temp/postgres-version
supabase db start --from-backup db_cluster.backup
```
Note that the earliest Supabase Postgres version that supports a local restore is `15.1.0.55`. If your hosted project was running on earlier versions, you will likely run into errors during restore. Before submitting any support ticket, make sure you have attached the error logs from `supabase_db_*` docker container.
Once your local database starts up successfully, you can connect using psql to verify that all your data is restored.
```sh
psql 'postgresql://postgres:postgres@localhost:54322/postgres'
```
If you want to use other services like Auth, Storage, and Studio dashboard together with your restored database, restart the local development stack.
```sh
supabase stop
supabase start
```
A Postgres database started with Supabase CLI is not production ready and should not be used outside of local development.
#### Disk sizing
When upgrading, the Supabase platform will "right-size" your disk based on the current size of the database. For example, if your database is 100GB in size, and you have a 200GB disk, the upgrade will reduce the disk size to 120GB (1.2x the size of your database).