Docker-gitlab: Upgrade to 13.7 which also upgrades to postgres 12 requires DB migration instructions

Created on 28 Dec 2020  路  4Comments  路  Source: sameersbn/docker-gitlab

Upgrade from 13.6 to 13.7 changes the version of Postgres and that means the database needs to be migrated as well.
In my case, using vanilla Postgres (in Docker), changing from version 11 to 12 caused an error postgresql database files are incompatible with server when starting Postgres.
The documentation should include a note about this.

As to the issue itself, it can be resolved easily with help of the following project: https://github.com/tianon/docker-postgres-upgrade
The upgrade of the DB consists of:

  1. Identify the mode of operation based on how the DB data folders are organized. Based on your setup, you will be able to use parameter --link or not and the only difference is performance of the migration.
  2. Stop the Postgres server
  3. Run the docker command (docker run ...) and pipe the output to a log file. There is lots of output.
  4. Copy the file pg_hba.conf from old data directory to new data directory. The file is there in new directory but server wont work with new file. (this file might be in the volume if you are using volumes)
  5. Start the Postgres server and point it to new data directory.

Hope this helps someone.

Most helpful comment

Hi @solidnerd,

I see the Postgres image referenced in the documentation does handle the migration automatically so this issue will only apply to those who run different/vanilla Postgres. I will send a PR with this information.

All 4 comments

Hey @tomastzn,
thanks for your report.

Your problem could be related to the circumstances that you got in the Postgres container a latest folder under /var/lib/postgres/latest instead of /var/lib/postgres/11. I tested the migration and for me, it was working out of the box.

I would really appreciate a pull request with a documentation update 馃憤 馃挴

Hi @solidnerd,

I see the Postgres image referenced in the documentation does handle the migration automatically so this issue will only apply to those who run different/vanilla Postgres. I will send a PR with this information.

PR #2279 is up.

Was merged so we can close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

martinspaeth picture martinspaeth  路  3Comments

schmunk42 picture schmunk42  路  5Comments

rakesh-k picture rakesh-k  路  3Comments

STOIE picture STOIE  路  4Comments

cyklodev picture cyklodev  路  3Comments