Docker-gitlab: Postgres update as preparation of gitlab 13.0.0

Created on 25 May 2020  路  3Comments  路  Source: sameersbn/docker-gitlab

We are using the setup described here since a while.

The migration went pretty smooth over the years. With the deprecation of Postgres < 11 introduced in Gitlab 13 I was wondering how i can prepare the migration to the new gitlab 13.0 in respect of our old postgres installation.

We use the following Postgres image:
sameersbn/postgresql:9.6-2

Thank you for your support and all the effort you put into this repo!

Most helpful comment

ok i did it and everything worked out :crossed_fingers:

for others here are my migration steps to upgrade from 12.10.6 to 13.0.0:

  1. stop container
$ docker-compose down
  1. edit docker-compose.yml (replace image tags see diff below)
$ diff docker-compose.old.yml docker-compose.yml 
6c6
<     image: sameersbn/redis:latest 
---
>     image: redis:5.0.9
16c16
<     image: sameersbn/postgresql:9.6-2 
---
>     image: sameersbn/postgresql:11-20200524 
  1. backup mounted postgresql:
$ grep -A 4 'postgresql:' docker-compose.yml 
  postgresql:
    restart: always
    image: sameersbn/postgresql:11-20200524 
    volumes:
    - /srv/docker/gitlab/postgresql:/var/lib/postgresql:Z
# cp -r /srv/docker/gitlab/postgresql /backup/gitlab/
  1. remove all but latest version in postgresql volume (for me 9.6 was the latest)
$ ls -l /srv/docker/gitlab/postgresql/
total 16
drwx------ 3 systemd-resolve systemd-resolve 4096 Jun 12  2018 9.6
  1. pull new images
$ docker-compose pull
  1. start container
$ docker-compose up -d

:crossed_fingers:

All 3 comments

Hey @martinspaeth,
there was a discussion about how to migrate you can check this out: https://github.com/sameersbn/docker-gitlab/pull/2154#issuecomment-633497099

@martinspaeth
hi i have exacatly the same problem and i am unsure with @solidnerd hint to the discussion in #2154

my current setup is: (gitlab 12.10.6)

...
postgresql:
    restart: always
    image: sameersbn/postgresql:9.6-2
    volumes:
    - /srv/docker/gitlab/postgresql:/var/lib/postgresql:Z
    - gitlab_network
  gitlab:
    restart: always
    image: sameersbn/gitlab:latest
    depends_on:
    - redis
    - postgresql
    ports:
    - "10080:80"
    - "22:22"
    volumes:
    - /srv/docker/gitlab/gitlab:/home/git/data:Z
    - /srv/docker/certs:/certs

i am unsure how to upgrade this setup ... should i version pin the postgres service to 11.2 and then run a docker-compose pull and recreate ? there are two major version bumbs in the postgres service ....

thank u for help!

ok i did it and everything worked out :crossed_fingers:

for others here are my migration steps to upgrade from 12.10.6 to 13.0.0:

  1. stop container
$ docker-compose down
  1. edit docker-compose.yml (replace image tags see diff below)
$ diff docker-compose.old.yml docker-compose.yml 
6c6
<     image: sameersbn/redis:latest 
---
>     image: redis:5.0.9
16c16
<     image: sameersbn/postgresql:9.6-2 
---
>     image: sameersbn/postgresql:11-20200524 
  1. backup mounted postgresql:
$ grep -A 4 'postgresql:' docker-compose.yml 
  postgresql:
    restart: always
    image: sameersbn/postgresql:11-20200524 
    volumes:
    - /srv/docker/gitlab/postgresql:/var/lib/postgresql:Z
# cp -r /srv/docker/gitlab/postgresql /backup/gitlab/
  1. remove all but latest version in postgresql volume (for me 9.6 was the latest)
$ ls -l /srv/docker/gitlab/postgresql/
total 16
drwx------ 3 systemd-resolve systemd-resolve 4096 Jun 12  2018 9.6
  1. pull new images
$ docker-compose pull
  1. start container
$ docker-compose up -d

:crossed_fingers:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lenovouser picture lenovouser  路  3Comments

schmunk42 picture schmunk42  路  5Comments

pmoralesp picture pmoralesp  路  3Comments

Nepoxx picture Nepoxx  路  5Comments

WeiLiPenguin picture WeiLiPenguin  路  4Comments