Skip to content

Instantly share code, notes, and snippets.

@tjmw
Last active January 4, 2016 19:09
Show Gist options
  • Save tjmw/52d6f2c21c06e4a2c080 to your computer and use it in GitHub Desktop.
Save tjmw/52d6f2c21c06e4a2c080 to your computer and use it in GitHub Desktop.
Upgrading Postgres from 9.2 to 9.3 on OS X Mavericks with Homebrew

Upgrade Postgres

$ brew update
$ brew upgrade brew upgrade postgresql

Migrate Existing data files

Move old data files out of the way

$ mv /usr/local/var/postgres /usr/local/var/postgres-9.2.x

Initialize a new postgres data directory

$ initdb /usr/local/var/postgres -E utf8

Migrate old files

$ pg_upgrade -b /usr/local/Cellar/postgresql/9.2.x/bin/ \
  -B /usr/local/Cellar/postgresql/9.3.x/bin/ \
  -d /usr/local/var/postgres-9.2.x/ \
  -D /usr/local/var/postgres/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment