서버를 이전한 후 포럼 내부의 많은 링크가 깨졌습니다. 이전 작업을 돕기 위해 임시 URL인 staging.example.com에 새 서버를 생성했었는데, 이제 이전 작업은 완료되었지만 forum.example.com의 많은 링크가 여전히 staging.example.com(더 이상 존재하지 않는 도메인)을 가리키고 있습니다.
> /var/www/discourse# discourse remap staging.example.com forum.example.com
> Rewriting all occurences of staging.example.com to forum.example.com
> THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES)
> YES
> Error: ERROR: duplicate key value violates unique constraint "unique_post_links"
> DETAIL: Key (topic_id, post_id, url)=(8718, 57455, https://forum.example.com/t/exampletopic/4606/336) already exists.
> The remap has only been partially applied due to the error above. Please re-run the script again.
지시에 따라 다시 실행해 보았지만, 동일한 (topic_id, post_id, url) 키에서 동일한 오류가 발생했습니다.
Rails 콘솔에 접근하여 SQL/ActiveRecord를 실행할 수 있습니다. 실행할 내용을 알려주시면 됩니다. 또는 Data Explorer를 사용할 수도 있습니다.