# 링크 재매핑 시도 시 오류 발생

**URL:** <https://meta.discourse.org/t/error-on-attempting-to-remap-links/278443>\
**Category:** Bug\
**Created:** [9월 10, 2023, 3:39오전 UTC](https://meta.discourse.org/t/error-on-attempting-to-remap-links/278443 "2023-09-10T03:39:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)\
**Post date:** [9월 10, 2023, 3:39오전 UTC](https://meta.discourse.org/t/error-on-attempting-to-remap-links/278443/1 "2023-09-10T03:39:08Z")

</div>

[Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-your-discourse/16098) 문서에 따라 최근 이전한 인스턴스에서 링크를 재매핑하려고 할 때 다음과 같은 오류가 발생합니다.

> root@ehealthforum-nz-syd01-web-only:/var/www/discourse# discourse remap [draft.ehealthforum.nz](http://draft.ehealthforum.nz) [ehealthforum.nz](http://ehealthforum.nz)  
> Rewriting all occurrences of [draft.ehealthforum.nz](http://draft.ehealthforum.nz) to [ehealthforum.nz](http://ehealthforum.nz)  
> THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES)  
> YES  
> Error: ERROR: duplicate key value violates unique constraint “index\_post\_hotlinked\_media\_on\_post\_id\_and\_url\_md5”  
> DETAIL: Key (post\_id, md5(url::text))=(80591,66a0d020b208dc9f8452a5eb9617f6bc) already exists.  
> The remap has only been partially applied due to the error above. Please re-run the script again.

조금 난해해 보이지만, 다른 사용자들도 이 문제로 인해 어려움을 겪을 가능성이 큽니다. [이 문제](https://meta.discourse.org/t/upgrade-fails-on-duplicate-key-error-index-post-hotlinked-media-on-post-id-and-url-md5/226002)와 유사하지만, 업그레이드 시가 아닌 재매핑 과정에서 발생했습니다.

Onebox가 포함된 게시글에서 발생하는 것으로 보입니다. 그런 게시글이 아주 많습니다!

---

_[View the full topic](https://meta.discourse.org/t/error-on-attempting-to-remap-links/278443)._
