container icon indicating copy to clipboard operation
container copied to clipboard

Postgres upgrade instructions missing

Open nidico opened this issue 3 years ago • 3 comments

Postgres has recently (in 9469c231add3f98c262bc51a088f147571501f36) been upgraded from 9.6 to 13.4 in the default/example docker-compose.yml file.

Users just upgrading the container repo will face the following error:

The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 13.4.

Database upgrade instructions should be added to the docker upgrade notes.

nidico avatar Sep 19 '21 00:09 nidico

I wrote a first draft for a guide, maybe needs some testing and validation: https://demo.hedgedoc.org/WDjvPVweTBWqVyUEg8A6Kw#

Feel free to try it and give some feedback :)

SISheogorath avatar Sep 20 '21 19:09 SISheogorath

Thanks!

I've tried it and it works for me when changing exec -t to exec -T in step 11.

nidico avatar Sep 20 '21 21:09 nidico

Thanks a lot for this guide!

I followed these steps, but unfortunately, all our pads were empty after step 11. I'm not sure what exactly went wrong. There were no error messages logged to the console; in fact, step 11 produced no output at all.

I tried the following command from the official documentation instead:

cat backup-$(date +%Y-%m-%d).sql | docker exec -i $(docker-compose ps -q database) psql -U hedgedoc

This produced many lines of SQL console messages (like ALTER TABLE, COPY, ...). Now everything seems to work again.

GrSto avatar Oct 10 '21 09:10 GrSto