Skip to content

Instantly share code, notes, and snippets.

@mxey
Created December 23, 2014 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxey/abbb58b0feeca062a34e to your computer and use it in GitHub Desktop.
Save mxey/abbb58b0feeca062a34e to your computer and use it in GitHub Desktop.
Upgrade PostgreSQL data directory on OS X
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
mv /usr/local/var/postgres/ /usr/local/var/postgres.old
initdb /usr/local/var/postgres/
pg_upgrade -b /usr/local/Cellar/postgresql/9.3.5_1/bin/ -B /usr/local/Cellar/postgresql/9.4.0/bin/ -d /usr/local/var/postgres.old/ -D /usr/local/var/postgres/
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
psql postgres -c ''
rm -r /usr/local/var/postgres.old
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment