postgresql - how to upgrade Postgres from 9.4 to 9.5 without losing data? -



postgresql - how to upgrade Postgres from 9.4 to 9.5 without losing data? -

i'm using postgresql database ruby on rails application (on mac osx 10.9)

is detail upgrade instruction upgrad postgresql database,

i'm afraid destroy info in database or mess it.

assuming you've used home-brew install , upgrade postgres, can perform next steps.

stop current postgres server:

launchctl unload ~/library/launchagents/homebrew.mxcl.postgresql.plist

initialize new 9.5 database:

initdb /usr/local/var/postgres9.5 -e utf8

run pg_upgrade:

pg_upgrade -v \ -d /usr/local/var/postgres \ -d /usr/local/var/postgres9.5 \ -b /usr/local/cellar/postgresql/9.4.5_2/bin/ \ -b /usr/local/cellar/postgresql/9.5.0/bin/

move new info place:

cd /usr/local/var mv postgres postgres9.4 mv postgres9.5 postgres

restart postgres:

launchctl load ~/library/launchagents/homebrew.mxcl.postgresql.plist

check /usr/local/var/postgres/server.log details , create sure new server started properly.

finally, re-install rails pg gem

gem uninstall pg gem install pg

i suggest take time read postgresql documentation understand you're doing in above steps minimize frustrations.

postgresql upgrade

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -