# 백업 복원 실패

**URL:** https://meta.discourse.org/t/backup-restoration-fails/405387
**Category:** Self-hosting
**Tags:** backups
**Created:** [6월 16, 2026, 8:15오전 UTC](https://meta.discourse.org/t/backup-restoration-fails/405387 "2026-06-16T08:15:13Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [6월 16, 2026, 9:48오전 UTC](https://meta.discourse.org/t/backup-restoration-fails/405387/2 "2026-06-16T09:48:01Z")

</div>

안녕하세요, 그리고 9년 만에 다시 돌아오셨네요!

이렇게 오랫동안 운영 중인 포럼을 보니 정말 멋집니다.

이것은 아마도 여기에서 논의되었던 것과 동일한 인덱스 문제일 것 같습니다: [Can't restore due to corrupt indexes (with some clues on how to deal with corrupt indexes)](https://meta.discourse.org/t/cant-restore-due-to-corrupt-indexes-with-some-clues-on-how-to-deal-with-corrupt-indexes/137400)

대략 다음과 같은 상황입니다:

`incoming_referers` 테이블은 방문자를 포럼으로 유도한 URL 경로를 추적합니다. 이 테이블에는 고유 인덱스가 있어 두 행이 동일한 경로 + 도메인 조합을 가질 수 없습니다.

데이터베이스에는 `path='//'`이고 `incoming_domain_id=5`인 두 개의 행이 있습니다. 복원 과정에서 이 고유 인덱스를 다시 구축하려고 할 때 중복 항목을 발견하고 전체 복원 트랜잭션을 중단합니다.

따라서 중복된 `incoming_referers`를 찾아 정리한 후, 새 서버에 복원할 수 있도록 새로운 백업을 만들어야 합니다.

도움이 될 수 있는 [설명서가 포함된 이 주제](https://meta.discourse.org/t/error-importing-backup-could-not-create-unique-index/207766/7?u=chapoi)를 찾았습니다.

> [@glynhudson](#):
>
> 컨테이너에 진입
> 
> `./launcher enter app`
> 
> 데이터베이스에 연결
> 
> `su postgres -c 'psql discourse'`
> 
> 중복 항목을 찾아보기
> 
> ```plaintext
> discourse=# select * from incoming_referers where path LIKE '%/search/' ORDER BY incoming_domain_id;`
> 
> id | path | incoming_domain_id
> ------+------------+--------------------
> 3339 | /search/ | 33
> 6257 | /search/ | 91
> 1567 | /search/ | 298
> 1777 | /search/ | 341
> 3010 | /search/ | 418
> 6247 | /search/ | 418
> 4293 | /search/ | 644
> 2899 | /search/ | 653
> 3447 | /search/ | 793
> 3696 | /search/ | 852
> 4395 | /a/search/ | 1050
> 6968 | /search/ | 1305
> 5634 | /search/ | 1387
> 5834 | /search/ | 1437
> 6519 | /search/ | 1637
> 7127 | /search/ | 1787
> 7280 | /search/ | 1827
> (17 rows)
> 
> ```
> 
> 중복 항목 삭제
> 
> `DELETE FROM incoming_referers WHERE path LIKE '%/search/' AND id IN (6247);`
> 
> 그리고 다시 구축
> 
> ```plaintext
> discourse=# REINDEX SCHEMA CONCURRENTLY public;
> WARNING: cannot reindex invalid index "public.incoming_referers_pkey_ccnew" concurrently, skipping
> WARNING: cannot reindex invalid index "public.index_incoming_referers_on_path_and_incoming_domain_id_ccnew" concurrently, skipping
> WARNING: cannot reindex invalid index "pg_toast.pg_toast_20732_index_ccnew" concurrently, skipping
> REINDEX
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/backup-restoration-fails/405387)._
