Open link in a new tab

Content

Expand project menu

Migration OP 11 with PG 9.6 to OP 12 with PG 13 failed

I have a working docker installation of OP11 using this compose file:

  openproject:
    image: openproject/community:11
    restart: always
    environment:
      SECRET_KEY_BASE: secret
      DATABASE_URL: postgres://openproject:****@dbpg/openproject
    ports:
      - "9040:80"
    volumes:
      - "./openproject/logs:/var/log/supervisor"
      - "./openproject/static:/var/openproject/assets"

  dbpg:
    image: postgres:9.6-alpine
    restart: always
    volumes:
      - "./dbpg/pgdata:/var/lib/postgresql/data"
    ports:
      - "9011:5432"

I try to migrate to OP 12, following https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql13/#all-in-one-docker-installation. It does not work.

Steps I have done:

docker run --rm -it \
 -v /home/frankhintsch/docker/v11/dbpg/pgdata:/var/openproject/pgdata \
 -v /home/frankhintsch/docker/v11/openproject/pgdata-next:/var/openproject/pgdata-next \
 openproject/community:12 root ./docker/prod/postgres-db-upgrade

This was successful.

But when I started the DB-content (without pointer to external database container)

  openproject:
    image: openproject/community:12
      #    restart: always
    environment:
      SECRET_KEY_BASE: secret
      OPENPROJECT_HTTPS: "false"
      OPENPROJECT_HSTS: "false"
    ports:
      - "9042:8080"
    volumes:
      - "./openproject/pgdata-next:/var/openproject/pgdata"

I faced several pitfalls.

  1. psql: error: connection to server at "127.0.0.1", port 5432 failed: FATAL:  role "openproject" does not exist:
    I created User + Role "openproject" with psql
  2. psql: error: connection to server at "127.0.0.1", port 5432 failed: FATAL:  database "openproject" does not exist
    I looked at the list of databases and it looks like nothing has been migrated
postgres=# \l
                             List of databases
   Name    |  Owner   | Encoding | Collate |  Ctype  |   Access privileges   
-----------+----------+----------+---------+---------+-----------------------
 postgres  | postgres | UTF8     | C.UTF-8 | C.UTF-8 | 
 template0 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
           |          |          |         |         | postgres=CTc/postgres
 template1 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
           |          |          |         |         | postgres=CTc/postgres

Can anyone help me?

Thanks in advance

Frank