Skip to content

Instantly share code, notes, and snippets.

@ammarhaiderak
Created July 11, 2025 13:42
Show Gist options
  • Select an option

  • Save ammarhaiderak/e71ef7489cfbc5463669680573160079 to your computer and use it in GitHub Desktop.

Select an option

Save ammarhaiderak/e71ef7489cfbc5463669680573160079 to your computer and use it in GitHub Desktop.

1. Dump remote db which is only accessible through proxy

step 1: create ssh tunnel to proxy

ssh -L localhost:5433:database-host:5432 ubuntu@proxy-server-ip -i your-private-key.cer

step 2: dump using pg_dump

pg_dump -f ./dump.sql -d postgres_user -h localhost -p 5433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment