Install Discourse for development using Docker

Thanks for the suggestion @mentalstring . Oddly, the Postgres main log /var/log/postgresql/postgresql-13-main.log is empty.

But there is a clue in some of the other files under the /var/log/ structure. The file /var/log/postgres/current is completely filled with repeated errors like this.

2020-12-11 20:06:34.875 UTC [11680] FATAL:  database files are incompatible with server
2020-12-11 20:06:34.875 UTC [11680] DETAIL:  The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.1 (Debian 13.1-1.pgdg1
00+1).

Some judicious Googling reveals that the raw DB format is incompatible and that a pg_upgrade command needs to be run.

I can’t see that command in PATH. Either way, a further bit of Googling reveals that Docker-based system struggle with this as both the old and new versions of Postgres need to be present for it to work.

Some further questions for anyone that can help

  • Is this a fundamental problem with using Docker in development for this upgrade?
  • Did I somehow miss a step?
  • Can I convert now?
  • Last resort how can I nuke the current data so boot_dev --init re-creates the database at Postgres 13?

Thanks in advance.

1 Like