# 更改站点 URL 后运行 remap 时出错

**URL:** <https://meta.discourse.org/t/error-running-remap-after-changing-site-url/406649>\
**Category:** Self-hosting\
**Tags:** sql-query, domains, postgres\
**Created:** [2026年七月2日 13:59 UTC](https://meta.discourse.org/t/error-running-remap-after-changing-site-url/406649 "2026-07-02T13:59:51Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)\
**Post date:** [2026年七月2日 13:59 UTC](https://meta.discourse.org/t/error-running-remap-after-changing-site-url/406649/1 "2026-07-02T13:59:52Z")

</div>

我更改了 Discourse 站点的 URL，并正在按照 [Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-your-discourse/16098) 中的说明进行操作。在尝试运行 remap 时，我反复遇到以下错误。它一直提示我重新运行脚本，但每次都会出现相同的错误。\[1\]

我不确定下一步该怎么做，如果能得到指导将不胜感激。提前感谢！🌱

```bash
root@digitallysovereign:/var/discourse# ./launcher enter app
x86_64 arch detected.
root@digitallysovereign-app:/var/www/discourse# discourse remap discourse.tobiaseigen.org digitallysovereign.org
Rewriting all occurrences of discourse.tobiaseigen.org to digitallysovereign.org
WILL RUN ON 'default' DB
THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES): YES

Remapping tables on default...

ai_api_audit_logs=919
ai_secrets=1
backup_metadata=1
browser_pageview_events=3664
Error: ERROR: duplicate key value violates unique constraint "idx_bprd_rollups_date_referrer_unique"
DETAIL: Key (date, normalized_referrer)=(2026-07-01, digitallysovereign.org) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.
root@digitallysovereign-app:/var/www/discourse# discourse remap discourse.tobiaseigen.org digitallysovereign.org
Rewriting all occurrences of discourse.tobiaseigen.org to digitallysovereign.org
WILL RUN ON 'default' DB
THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES): YES

Remapping tables on default...

Error: ERROR: duplicate key value violates unique constraint "idx_bprd_rollups_date_referrer_unique"
DETAIL: Key (date, normalized_referrer)=(2026-07-01, digitallysovereign.org) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.
root@digitallysovereign-app:/var/www/discourse# discourse remap discourse.tobiaseigen.org digitallysovereign.org
Rewriting all occurrences of discourse.tobiaseigen.org to digitallysovereign.org
WILL RUN ON 'default' DB
THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES): YES

Remapping tables on default...

Error: ERROR: duplicate key value violates unique constraint "idx_bprd_rollups_date_referrer_unique"
DETAIL: Key (date, normalized_referrer)=(2026-07-01, digitallysovereign.org) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.

```

* * *

1. 我知道“疯狂”的定义就是反复做同一件事却期待不同的结果！🤣

---

_[View the full topic](https://meta.discourse.org/t/error-running-remap-after-changing-site-url/406649)._
