So somewhere you changed the postgres port to 50432 instead of 5432? (OR maybe the migration code does that and I’ve never noticed).
Maybe switch to the postgres13 template as suggested in the OP? And if that works, what I would do is move to a new server and avoid the whole transition-to-new-postgres-version issue and just restore the database to the new server.
I don’t have enough space to perform this upgrade on my Discourse partition. However, I have plenty of space on another drive. Is there a way to use this for the temporary storage?
It’s probably time for an OS upgrade anyway, and moving to a fresh VM is much easier, requires little downtime, and if something goes wrong, you still have a working server.
If you’ve got a separate data container, you can try moving all of /var/discourse/shared/data to the other partition and adjusting the volumes in your YML accordingly.
And if you don’t have a separate container, you can do something like that, it’s just more complicated.
제 경우: 업데이트를 진행하던 중 앱(제 경우 웹 전용) 컨테이너가 재빌드되지 않는 문제가 발생했습니다. rss-polling을 커스텀 플러그인으로 추가해 두었는데, 이것이 새로운 기본 설정과 충돌하는 것 같았습니다. 해당 플러그인을 제거한 후에는 정상적으로 작동했습니다.
하지만 그 후 vector 확장 프로그램이 없다는 오류가 발생했습니다. 이는 데이터 컨테이너를 오랫동안 재빌드하지 않았기 때문이었습니다. 이제 13버전으로 재빌드하는 데 성공했지만, 현재 13버전이 실행 중인 상태에서 data.yaml을 postgres.template 또는 postgres.15.template으로 변경하면 마이그레이션이 실패합니다.
처음에는 “unclean shutdown” 오류가 발생했는데, 위의 힌트를 참고하여 해결했습니다. 하지만 지금은 마이그레이션이 실패하는데, 13버전 설치 파일이 없는 것 같습니다. /shared 디렉터리에 남은 잔여 파일 때문일까요? (이미 postgres_new 디렉토리를 정리해 보았습니다.)
-----------------------------------------------------------------
pg_upgrade run on Fri Oct 17 09:54:37 2025
-----------------------------------------------------------------
command: "/usr/lib/postgresql/13/bin/pg_ctl" -w -l "/shared/postgres_data_new/pg_upgrade_output.d/20251017T095437.518/log/pg_upgrade_server.log" -D "/shared/postgres_data" -o "-p 50432 -b -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/lib/postgresql'" start >> "/shared/postgres_data_new/pg_upgrade_output.d/20251017T095437.518/log/pg_upgrade_server.log" 2>&1
waiting for server to start....2025-10-17 09:54:37.744 UTC [1900] LOG: starting PostgreSQL 13.22 (Debian 13.22-1.pgdg12+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14+deb12u1) 12.2.0, 64-bit
2025-10-17 09:54:37.749 UTC [1900] LOG: listening on Unix socket "/var/lib/postgresql/.s.PGSQL.50432"
2025-10-17 09:54:37.760 UTC [1900] LOG: could not open configuration file "/etc/postgresql/13/main/pg_hba.conf": No such file or directory
2025-10-17 09:54:37.760 UTC [1900] FATAL: could not load pg_hba.conf
2025-10-17 09:54:37.762 UTC [1900] LOG: database system is shut down
stopped waiting
pg_ctl: could not start server
Examine the log output.
```
네, 현재 PG13 컨테이너를 사용 중입니다. 여러 번 재빌드해 보았으며, 떠 있는 _new 디렉터리까지 정리했습니다. 그런데 15 버전이나 공식 버전 미지정 템플릿으로 전환을 시도할 때마다 실패합니다. 이 문제가 스스로 해결되지 않는다면 곧 수동으로 마이그레이션할 예정입니다. 여기서 OS가 왜 관련이 있는지 모르겠습니다.
참고로 postgres.15.template과 postgres.template의 스크립트 순서가 다른데, 업데이트를 위해 어느 쪽이 더 나은가요?