Skip to content

Instantly share code, notes, and snippets.

@johnpaulashenfelter
Created November 11, 2011 15:31
Show Gist options
  • Save johnpaulashenfelter/1358268 to your computer and use it in GitHub Desktop.
Save johnpaulashenfelter/1358268 to your computer and use it in GitHub Desktop.
Upgrading homebrew postgres from 9.0.x to 9.1
Upgrading to homebrew postgresql 9.1.1 from 9.0.x
* Copy the old data
mv -R /usr/local/var/postgres/ /usr/local/var/postgres-901
* Create a new database using 9.1.1
/usr/local/Cellar/postgresql/9.1.1/bin/initdb /usr/local/var/postgres
* Upgrade old data to new format
/usr/local/Cellar/postgresql/9.1.1/bin/pg_upgrade --old-datadir '/usr/local/var/postgres-901/' --new-datadir '/usr/local/var/postgres' --old-bindir '/usr/local/Cellar/postgresql/9.0.4/bin/' --new-bindir '/usr/local/Cellar/postgresql/9.1.1/bin/'
* Update db stats (optional)
/usr/local/Cellar/postgresql/9.1.1/bin/vacuumdb --all --analyze-only
* Remove old files
/usr/local/Cellar/postgresql/9.1.1/bin/delete_old_cluster.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment