Skip to content

Instantly share code, notes, and snippets.

@Flip-Liquid
Flip-Liquid / postgres-backup.md
Last active May 15, 2023 17:46
A quick step-by-step to backup and restore a remote postgres database

Backing up postgres DBs

Our data is hosted in postgres clusters accessible via the internet. Follow these steps to backup a remote instance, and restore the data on your local instance.

This example assumes the remote cluster is using postgres version 14.

  1. Install postgresql 14 on your machine. This will give you access to the pg_dump tool, which we'll use to take a backup of our cloud postgres instance.
    • OSX steps (make sure to replace 13 with 14)
    • (Linux steps) run sudo apt-get install postgres-14
  2. Ensure you have access to a DB role that has the proper permissions to access staging data