S
Supabase5d ago
MaxL

Struggling to configure local environment from remote database that was managed through website

I have recently been added to a project to help configure Prod/Staging/Dev envirionments. The project has been majorly managed by vibe-coding manual SQL mgirations into the web SQL editor, and therefore the migration files are lost. Production works. To create staging I created a new Supabase project and dumped the schemas/roles/data using database connection and migration scripting for PostgreSQL. Now I am trying to configure the local db (supabase start/ supabase db reset) working backwards from the remote db. I have configured the config.toml file to have the following settings:
[db.migrations] If disabled, migrations will be skipped during a db push or reset. enabled = true Specifies an ordered list of schema files that describe your database. Supports glob patterns relative to supabase directory: "./schemas/*.sql" schema_paths = ["./localsupabaseusage/roles.sql", "./localsupabaseusage/schema.sql"] [db.seed] If enabled, seeds the database after migrations during a db reset. enabled = false Specifies an ordered list of seed files to load during db reset. Supports glob patterns relative to supabase directory: "./seeds/*.sql" sql_paths = ["./localsupabaseusage/data.sql"]
When running supabase db reset it doesnt load the data unless I run the following commands:
1) roles (creates stripe_webhook, etc.) PGPASSWORD=postgres psql "host=127.0.0.1 port=54322 dbname=postgres user=postgres" -f supabase/localsupabaseusage/roles.sql 2) schema (tables, functions, RLS) PGPASSWORD=postgres psql "host=127.0.0.1 port=54322 dbname=postgres user=postgres" -v ON_ERROR_STOP=1 -f supabase/localsupabaseusage/schema.sql 3) data PGPASSWORD=postgres psql "host=127.0.0.1 port=54322 dbname=postgres user=postgres" -v ON_ERROR_STOP=1 -f supabase/localsupabaseusage/data.sql services + Studio supabase start
In addition, the Azure sign in on localhost doesnt work. How do I configure that?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?