Skip to content

How to export and import a database inside supabase #773

Discussion options

You must be logged in to vote

You have the database connection string on /settings/database, you copy it and then you can connect to your db from your terminal(psql <connection_string>) or any other client.

Then:

pg_dump <connection_string_from_db_1> -> extract the dump -> pg_restore -d <connection_string_from_db_2> dump

The databases share some tables/schemas, so a full dump could fail. An option would be to pg_dump specific tables that you want and only restore them on the other database.

Replies: 7 comments 13 replies

Comment options

You must be logged in to vote
4 replies
@SandroMaglione
Comment options

@SandroMaglione
Comment options

@MentalGear
Comment options

@sagar-jani
Comment options

Answer selected by SandroMaglione
Comment options

You must be logged in to vote
6 replies
@awalias
Comment options

@jdcauley
Comment options

@gillkyle
Comment options

@riderx
Comment options

@riderx
Comment options

Comment options

You must be logged in to vote
1 reply
@logemann
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Snailedlt
Comment options

Comment options

You must be logged in to vote
1 reply
@didier
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet