재구축 실패: 데이터 디렉터리 /shared/postgres_data의 소유자가 root일 수 없습니다

Well, it looks like you worked it out, but it would have been much easier to instead backup on the old server and restore the database on the new one. That way you don’t have to go through the postgres upgrade and you won’t need to muck with permissions. And you wouldn’t need to fool with the indexing and such that you probably didn’t read about in the PostgreSQL 15 update topic.