Created
August 2, 2017 17:33
-
-
Save hakjoon/ba76aa649e4b5e1b6de2c9522da9ece8 to your computer and use it in GitHub Desktop.
Revisions
-
hakjoon created this gist
Aug 2, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # You can see what the old version you have is by looking at # /usr/local/var/postgres/PG_VERSION brew services stop postgresql cp -r /usr/local/var/postgres /usr/local/var/postgres_bak #backup db just in case mv /usr/local/var/postgres /usr/local/var/postgres<OLD_VERSION> # move it form default location initdb /usr/local/var/postgres -E utf8 # create new DB in default location pg_upgrade \ -b /usr/local/Cellar/postgresql/<OLD_VERSION>/bin/ \ -B /usr/local/Cellar/postgresql/<NEW_VERSION>/bin/ \ -d /usr/local/var/postgres<OLD_VERSION> \ -D /usr/local/var/postgres pg_ctl -D /usr/local/var/postgres start # see if it worked