Skip to content

Instantly share code, notes, and snippets.

@rjfranco
Last active March 4, 2017 23:38
Show Gist options
  • Save rjfranco/6804834 to your computer and use it in GitHub Desktop.
Save rjfranco/6804834 to your computer and use it in GitHub Desktop.
Upgrade steps for homebrew postgresql database

Upgrading a PostgreSQL Database

When using homebrew, on OSX

  • launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist (old way)
  • brew services stop postgresql (new way)
  • mv /usr/local/var/postgres /usr/local/var/postgres.old
  • initdb /usr/local/var/postgres -E utf8
  • 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
  • ./delete_old_cluster.sh (automatically generated in current directory)
  • rm delete_old_cluster.sh
  • launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist (old way)
  • brew services start postgresql (new way)
@rjfranco
Copy link
Author

rjfranco commented Oct 3, 2013

Skip first and last step of course if you don't autorun postgres

@wobh
Copy link

wobh commented Dec 7, 2016

You can use brew services stop|start postgresql if you do autorun posgresql.

@rjfranco
Copy link
Author

rjfranco commented Mar 4, 2017

@wobh updated to reflect that, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment