Skip to content

Instantly share code, notes, and snippets.

@nonword
Created December 30, 2016 19:17
Show Gist options
  • Save nonword/d964e253f0ccd75dc02d0fedb9c88dd9 to your computer and use it in GitHub Desktop.
Save nonword/d964e253f0ccd75dc02d0fedb9c88dd9 to your computer and use it in GitHub Desktop.
upgrade postgres data dir from 9.4 to 9.6
# initialize directory:
initdb -D /usr/local/var/postgres96
# copy data from old directory
pg_upgrade -b /usr/local/Cellar/postgresql/9.4.4/bin -B /usr/local/Cellar/postgresql/9.6.1/bin -d /usr/local/var/postgres -D /usr/local/var/postgres96
# Ensure daemon startup specifies new directory:
postgres -D /usr/local/var/postgres96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment