# 업그레이드 실패: PostgreSQL 버전 13 ... 은(는) ... 버전 10.12(와)과(와) 호환되지 않음

**URL:** https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201
**Category:** Self-hosting
**Created:** [4월 17, 2021, 1:58오후 UTC](https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201 "2021-04-17T13:58:05Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ThePythonicCow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thepythoniccow/32/217413_2.png) [@ThePythonicCow](https://meta.discourse.org/u/ThePythonicCow)
#### Post date: [4월 17, 2021, 1:58오후 UTC](https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201/1 "2021-04-17T13:58:05Z")

</div>

저는 Discourse 기반으로 만든 작은 포럼([themooster.net](http://themooster.net))을 운영하고 있는데, 몇 달 동안 업그레이드를 하지 않았습니다.

관리자(Admin) 화면의 추천 사항에 따라 업그레이드를 하려고 “Update” 버튼을 클릭했는데, 셸 프롬프트에서 직접 업그레이드를 수행해야 한다는 메시지와 함께 실행해야 할 세 줄의 명령어가 표시되었습니다:

```
    cd /var/discourse
    git pull
    ./launcher rebuild app

```

이 세 가지 명령어를 실행했습니다. 처음에는 "rebuild app"이 실패했는데, 작은 Linode 서버에 5GB의 여유 공간이 없었기 때문입니다. 더 많은 디스크 공간을 추가한 후 "rebuild app"은 정상적으로 완료된 것처럼 보였습니다.

하지만 사이트가 다시 시작되지 않았습니다.

여기저기 살펴보고 재시작을 해보았지만 여전히 사이트가 올라오지 않았으며, 조금 더 자세히 살펴본 결과 다음과 같은 상황이었습니다.

프론트엔드 nginx는 정상적으로 시작되는 것 같지만, 일반 사용자처럼 웹으로 포럼에 접속하려고 하면 nginx 프론트엔드에서 “502 Bad Gateway” 오류가 발생합니다.

/var/discourse/shared/standalone/log/var-log/postgres/current 파일에는 다음과 같은 오류로 가득 차 있습니다:

2021-04-17 13:54:37.785 UTC [7095] FATAL: database files are incompatible with server  
2021-04-17 13:54:37.785 UTC [7095] DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 10.12 (Debian 10.12-2.pgdg100+1).

포럼의 좋은 상태의 백업은 다음 디렉토리에 있습니다:  
/var/discourse/shared/standalone/backups/default

이제 어떻게 해야 할까요?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [4월 17, 2021, 3:46오후 UTC](https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201/2 "2021-04-17T15:46:19Z")

</div>

[PostgreSQL 13 업데이트](https://meta.discourse.org/t/postgresql-13-update/172563)를 확인하세요

---

<div class="post-metadata">

### Author: ![ThePythonicCow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thepythoniccow/32/217413_2.png) [@ThePythonicCow](https://meta.discourse.org/u/ThePythonicCow)
#### Post date: [4월 17, 2021, 3:54오후 UTC](https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201/3 "2021-04-17T15:54:46Z")

</div>

지금 PostgreSQL 13 링크를 확인하겠습니다. 감사합니다.

PostgreSQL, Ruby, Linux 등 Discourse 뒤에 있는 주요 기술들의 활동을 상시적으로 추적하는 전문 관리자가 아닌 이상, 이 복잡성을 사전에 알 수 있는 방법이 있었을까요?

만약 있었다면, 3줄의 명령어(cd /var/discouse; …)에 "경고: 다른 관련 정보가 있을 수 있으므로 먼저 여기를 확인하세요."라는 한 줄을 추가할 수 있을까요?

그렇지 않다면, Discourse가 일상적인 사용에는 적합하지 않다는 점을 더 명확히 밝혀야 합니다.

---

<div class="post-metadata">

### Author: ![ThePythonicCow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thepythoniccow/32/217413_2.png) [@ThePythonicCow](https://meta.discourse.org/u/ThePythonicCow)
#### Post date: [4월 17, 2021, 4:06오후 UTC](https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201/4 "2021-04-17T16:06:55Z")

</div>

여러분이 친절하게 링크해 주신 PostgreSQL 13 업데이트 페이지를 몇 번 더 읽어보겠습니다.

하지만 처음 몇 번 읽어본 결과 … 거의 완전히 헤매고 있습니다. 제 상황에 해당되는 페이지의 섹션이 있는지(있다면 어떤 것인지) 전혀 모르겠습니다.

예를 들어, 그 PostgreSQL 13 업데이트 페이지는 (당연히도, 그렇게 생각합니다) PostgreSQL 12에서 13으로의 업그레이드에 초점을 맞추고 있습니다. 제 에러 메시지는 다음과 같습니다:

The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 10.12 (Debian 10.12-2.pgdg100+1).

여기서 10.12라고 언급하고 있는데, 이는 PostgreSQL 10을 의미하는 건지, 아니면 PostgreSQL 12를 의미하는 건지 궁금합니다(보통 "10.12"라고 하면 12보다는 10을 주로 의미한다고 읽습니다).

---

<div class="post-metadata">

### Author: ![ThePythonicCow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thepythoniccow/32/217413_2.png) [@ThePythonicCow](https://meta.discourse.org/u/ThePythonicCow)
#### Post date: [4월 17, 2021, 4:16오후 UTC](https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201/5 "2021-04-17T16:16:25Z")

</div>

아하 - 내 파일:

/var/discourse/shared/standalone/postgres\_data\_old/PG\_VERSION

의 값이 "10"입니다.

따라서 위에서 언급한 PostgreSQL 13 링크는, 12에서 13으로의 업그레이드에 적용되는 한도 내에서, 제 지식을 기준으로 볼 때(제 지식은 거의 없는 편입니다) 반드시 관련이 있다고 할 수 없습니다.

이 상황에 대해 정말 불안한 기분이 듭니다 … 마치 어두운 동굴에서, 설명서도 없이, 훈련도 받지 않은 상태에서, 심지어 어떤 종류의 탄약인지 확실하지도 않은 채로, 사용 중인 군용 탄약을 수리하려 하는 것과 비슷합니다.

---

<div class="post-metadata">

### Author: ![ThePythonicCow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thepythoniccow/32/217413_2.png) [@ThePythonicCow](https://meta.discourse.org/u/ThePythonicCow)
#### Post date: [4월 17, 2021, 4:53오후 UTC](https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201/6 "2021-04-17T16:53:22Z")

</div>

어제 우연히 발견한 이 댓글을 보고:

[https://meta.discourse.org/t/how-do-i-manually-update-discourse-and-docker-image-to-latest/23325/238?u=thepythoniccow](https://meta.discourse.org/t/how-do-i-manually-update-discourse-and-docker-image-to-latest/23325/238?u=thepythoniccow)

> “다시 재빌드(rebuild)해야 합니다. PostgreSQL 업그레이드에 대한 메시지를 무시했을 가능성이 크다고 추측합니다.”

라고 한 내용이 떠올라, “cd /var/discourse; git pull; ./launcher rebuild app” 명령을 다시 시도해 보았죠 … apparently 그 "rebuild"는 여러 번 시도해 볼 수 있는 것 같습니다.

이번에는 출력을 캡처해 두었습니다. 다만, 출력 메시지의 대부분을 무시했다는 것은 **보증** 합니다. “./launcher rebuild app” 명령 하나만으로도 2020줄에 달하는 출력이 나옵니다. 모든 프로그램이 무엇이고 그 출력 메시지의 의미를 파악하는 데는 일요일이 한 달은 걸릴 것 같습니다. 그 출력에서 중요한 것을 무시하고 있는지 아닌지를 알 수 있는 현실적인 방법이 없습니다.

하지만 …

_성공했습니다 !!_

제 웹사이트가 최신 버전의 소프트웨어로 다시 구동되기 시작했습니다.

**오늘의 교훈:** “_./launcher rebuild app_” 명령이 정상 작동하는 사이트를 제공하지 못하면, 다시 시도해 보세요.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [4월 17, 2021, 4:56오후 UTC](https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201/7 "2021-04-17T16:56:03Z")

</div>

아. 아까 그 사람에게 알려준 걸 당신에게도 말해줘야 했다는 걸 생각 못 했네요! 죄송합니다.

> [@ThePythonicCow](#):
>
> 되긴 했어요 !!

🎉 정말 좋습니다! 해결되어서 다행이에요!

> [@ThePythonicCow](#):
>
> **오늘의 교훈:** “ _./launcher rebuild app_ ” 명령어로 작동하는 사이트를 만들 수 없다면, 한 번 더 시도해 보세요.

네. 아마 당신이 알아야 할 다른 유일한 팁이 이것일 겁니다. 🙂

다시 복구되어서 다행이에요!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [5월 17, 2021, 4:56오후 UTC](https://meta.discourse.org/t/upgrade-failed-postgresql-version-13-not-compatible-with-version-10-12/187201/8 "2021-05-17T16:56:48Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
