I assume some-application
and some-application-db
are deployed.
Go to the some-application console:
fly ssh console -a some-application
Get the database name, login, and password:
echo $DATABASE_URL
It will show the string in the following format:
postgres://some_login:some_password@some-address.internal:5432/some_db_name?sslmode=disable
Go to the DB machine console:
fly ssh console -a some-application-db
Make a dump:
pg_dump --username=some_login --dbname=some_db_name --port=5432 --host=some-application-db.internal > some_path
Make sftp connection to the DB machine
fly ssh sftp shell -a some-application-db
Download the dump using SFTP session:
get /some_path