Skip to content

Instantly share code, notes, and snippets.

@benoitguigal
Last active October 27, 2021 12:07
Show Gist options
  • Save benoitguigal/3301a54e0e5687d5f084669a31075835 to your computer and use it in GitHub Desktop.
Save benoitguigal/3301a54e0e5687d5f084669a31075835 to your computer and use it in GitHub Desktop.

Stop prod API

scalingo --app trackdechets-production-api scale web:0:L

Start a one-off container

scalingo --app trackdechets-production-api run bash

Dump base de données de prod Scaleway

Depuis le one-off container

pg_dump -d $SCALEWAY_POSTGRESQL_URL -F c -f backup-prod.custom --no-owner

Restore backup

Depuis le one-off container

pg_restore -d $SCALINGO_POSTGRESQL_URL --no-owner backup-prod.custom

Scale app

scalingo --app trackdechets-production-api scale web:1:L

Change env variables

scalingo -a trackdechets-production-api env-set DATABASE_URL=<...>?sslmode=prefer&schema=default$default

Restart API

scalingo --app trackdechets-production-api restart

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