Skip to content

Instantly share code, notes, and snippets.

@raecoo
Created December 22, 2012 02:10
Show Gist options
  • Save raecoo/4357051 to your computer and use it in GitHub Desktop.
Save raecoo/4357051 to your computer and use it in GitHub Desktop.
Upgrade Postgres 9.1 to 9.2
cd /usr/local/var
mkdir postgres9.2
# Initialize a the new postgres 9.2 database
initdb /usr/local/var/postgres9.2
# Tell postgres we are upgrading the existing postgres database to the new postgres9.2 location
pg_upgrade -d /usr/local/var/postgres/ -D /usr/local/var/postgres9.2 -b /usr/local/Cellar/postgresql/9.1.4/bin/ -B /usr/local/Cellar/postgresql/9.2.1/bin/ -v
# Swap the folders
mv postgres postgres9.1.4
mv postgres9.2 postgres
# Remove this unnecessary helper file
rm delete_old_cluster.sh
# Restart postgres
launchctl unload -w homebrew.mxcl.postgresql.plist
launchctl load -w homebrew.mxcl.postgresql.plist
@raecoo
Copy link
Author

raecoo commented Dec 22, 2012

FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 9.1.4, which is not compatible with this version 9.2.1.

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