Base de dades
Automated backups using GitHub Actions
Backup
Section titled “Backup”In order to backup your Supabase database, you’ll need to use the pg_dump
command.
Make sure you have postgres installed on your machine.
The format of a Supabase PostgreSQL connection string is similar to a standard PostgreSQL connection string.
It typically includes the following components:
postgresql://myuser:mypassword@db.myproject.supabase.co:5432/mydatabase
Remember to replace myuser
, mypassword
, db.myproject.supabase.co
, and mydatabase
with your actual
database credentials and details. Also, ensure that your connection string is kept secure and not exposed
in your application code or any public repositories.
Now, let’s execute the pg_dump
command to backup your Supabase database:
pg_dump --inserts --column-inserts --username=myuser --host=db.myproject.supabase.co --port=5432 mydatabase > database-dump.sql
Or using the connection string:
pg_dump 'postgresql://myuser:mypassword@db.myproject.supabase.co:5432/mydatabase > database-dump.sql
El contingut d'aquest lloc web té llicència CC BY-NC-ND 4.0.
©2022-2025 xtec.dev