Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support restoring a user defined backup #1254

Merged
merged 4 commits into from
Oct 3, 2024
Merged

Conversation

olirice
Copy link
Contributor

@olirice olirice commented Oct 2, 2024

Projects that have been paused for > 90 days can not be restored on the platform automatically. Instead we allow them to download their logical backup.

This PR updates our tooling so users can attempt to restore their downloaded backup into a realistic supabase db where they'll have all the extensions they need.

This PR updates nix run .#start-client to

  • name the arguments to start-client
  • add a help --help
  • optionally allow a custom migration file (the backup)

If a backup file is not passed, start-client runs the default supabase migrations. If a file is passed, the default migrations are skipped because they'll be included in the user's backup

There will be a followup PR in supabase/supabase documenting how to use this repo to restore a db from a backup

› nix run .#start-client
Usage: nix run .#start-client -- [options]

Options:
  -v, --version [15|16|orioledb-16]  Specify the PostgreSQL version to use (required)
  -f, --file FILE                    Provide a custom migration script
  -h, --help                         Show this help message

Description:
  Starts an interactive 'psql' session connecting to a Postgres database started with the
  'nix run .#start-server' command. If a migration file is not provided, the client
  initializes the database with the default migrations for a new Supabase project
  if a migrations file is provided, default migrations are skipped
  If no migration file is provided, it runs the default Supabase migrations.

Examples:
  nix run .#start-client
  nix run .#start-client -- --version 15
  nix run .#start-client -- --version 16 --file custom_migration.sql
  nix run .#start-client -- --version 16 --port 5433

@olirice olirice requested a review from a team as a code owner October 2, 2024 21:25
nix/tools/run-client.sh.in Outdated Show resolved Hide resolved
@olirice olirice merged commit 6757ba0 into develop Oct 3, 2024
6 of 8 checks passed
@olirice olirice deleted the or/restore-user-backup branch October 3, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants