Docker Community Forums

Share and learn in the Docker community.

How to upgrade docker postgresql 9.5 into 9.6

docker
dockerhub

(120595) #1

Please help me.
How do i upgrade docker postgres into 9.6 without losing my current data on ubuntu 14?
thanks.


(Siju Oommen George) #2

This is just one of the ways to achieve it.

  1. Take a Database dump from the current database.

    https://www.postgresql.org/docs/9.4/static/backup-dump.html
    
  2. Install postgres 9.6 from Docker store

    $ sudo docker run postgres:9.6.5
    
  3. Restore the dump to the new 9.6.5 container.

Hope this helps :slight_smile:

–Siju


(120595) #3

thanks george. but i still got error.
There’s some error while i try to pg_dum dbname >outfile even i try it on root or
on postgresql.


(Junius) #4

try pg_dumpall? follow pg 9.6 upgrade doc: https://www.postgresql.org/docs/9.6/static/upgrading.html


(120595) #5

i still got this error. how to solve this?


(Junius) #6

looks you need to install postgresql-client-9.5. you could attach to the container, apt-get update, then install postgresql-client