Question

How to upgrade Dokku's PostgreSQL?

Posted August 8, 2015 2.7k views
Ubuntu PostgreSQL Dokku

Hey guys, I am using this potsgres plugin: https://github.com/Kloadut/dokku-pg-plugin
But they don’t provide any info on how to upgrade the postgresql version.

There is a fork that supports 9.4 version (https://github.com/atsoy/dokku-pg-plugin) so I removed the old one, installed the new one, but nothing happens.

The old db is still running and I don’t want to mess with it since there is no manual on how to do it.

Hopefully this helps other folks than just me.

edited by asb

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

Unfortunately, there is no easy way to accomplish this except for forking the plugin. With Dokku, everything is running inside of Docker containers including the database. If you look at the install script for Kloadut/dokku-pg-plugin, you’ll see that it builds a Docker image based on this Dockerfile:

FROM    ubuntu:trusty
MAINTAINER  kload "kload@kload.fr"

# prevent apt from starting postgres right after the installation
RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d; chmod +x /usr/sbin/policy-rc.d

RUN apt-get update
RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y -q postgresql-9.3 postgresql-contrib-9.3
RUN rm -rf /var/lib/apt/lists/*
RUN apt-get clean

# allow autostart again
RUN rm /usr/sbin/policy-rc.d

ADD . /usr/bin
RUN chmod +x /usr/bin/start_pgsql.sh
RUN echo 'host all all 0.0.0.0/0 md5' >> /etc/postgresql/9.3/main/pg_hba.conf
RUN sed -i -e"s/var\/lib/opt/g" /etc/postgresql/9.3/main/postgresql.conf

So the only way to run a different version of Postgres would be to fork the plugin and have it use a different Dockerfile.

Submit an Answer