How can I create a database dump?

Here’s my problem: I need the production data on my local machine.

Normally I would just pg_dump into my machine, but I’m to sure how to do it on this platform.

Could you help me out by pointing out where to read the appropriate docs.

Thanks!

1 Like

The easiest is to proxy Fly’s DB port on your local machine:

fly proxy 15432:5432 --app $TARGET_DB_APPNAME

Now you can reach the app locally at port 15432.
So you could run e.g.

pg_dump postgres://postgres:YOURPASSWORD@localhost:15432/YOURDBNAME --verbose --other --flags --here > ./some_local_filename

Here is more info in the docs.

5 Likes

Thanks! :v:

Broken link; it’s now at Docs → Postgres → Connecting to Apps → Connecting to Fly Postgres From Outside Fly