Help using pg_dump

Hello, I was wondering how to use pg_dump to download the contents of my database for offline storage so I can have a "secure" way to back up my databases. I am just kind of lost and don't really even know where to start I have pg_dump installed and a user created but how do I connect to my database and so on and so forth. Any help would be greatly appreciated, thank you.
7 Replies
Prisma AI Help
Prisma AI Help5mo ago
Ahoy, knowledge seeker! I'm the Prisma AI Help Bot. Do you want a dev's response that might take a hot second, or an AI answer that's ready before your next coffee sip? Either way, your question is important to us.
Nurul
Nurul5mo ago
Hey! To confirm, you would like to create a backup file of your Prisma Postgres instance? Did you see this docs section? https://www.prisma.io/docs/postgres/database/backups#2-creating-the-backup-with-pg_dump
Short Cirkuitz
Short CirkuitzOP5mo ago
Yes, the issue I’m having is the connection string and how that is utilized
Nurul
Nurul5mo ago
You can get a direct connection string (postgres:// one) that can be used with pg_dump by following the instructions from above link. In case you run into any timeout issues, you can also use @prisma/ppg-tunnel to connect to your prisma postgres instance and use this tunnel to create a backup file. Essentially this step but at last you replace pg_restore with pg_dump.
Short Cirkuitz
Short CirkuitzOP5mo ago
No description
Short Cirkuitz
Short CirkuitzOP5mo ago
I've tried everything I can think of
Nurul
Nurul5mo ago
Can you share the commands that you ran after starting ppg-tunnel? Or did you try this with direct postgres connection string?

Did you find this page helpful?