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.
/* 衝突する分析レコードを削除 */
DELETE FROM browser_pageview_rollup_details
WHERE normalized_referrer = 'discourse.tobiaseigen.org'
AND date IN (
SELECT date
FROM browser_pageview_rollup_details
WHERE normalized_referrer = 'digitallysovereign.org'
);
/* PostgreSQLを終了 */
\q
Error: ERROR: duplicate key value violates unique constraint "idx_bprd_rollups_date_referrer_unique"
DETAIL: Key (date, normalized_referrer)=(2026-06-30, digitallysovereign.org/c/members/32) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.
DELETE FROM browser_pageview_referrer_daily_rollups old_table
WHERE old_table.normalized_referrer LIKE '%discourse.tobiaseigen.org%'
AND EXISTS (
SELECT 1
FROM browser_pageview_referrer_daily_rollups new_table
WHERE new_table.date = old_table.date
AND new_table.normalized_referrer = REPLACE(old_table.normalized_referrer, 'discourse.tobiaseigen.org', 'digitallysovereign.org')
);
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...
browser_pageview_referrer_daily_rollups=1466
categories=2
chat_message_links=4
chat_message_search_data=4
chat_messages=5
discourse_activity_pub_collections=1
discourse_activity_pub_objects=1
drafts=4
email_logs=797
group_histories=2
groups=2
incoming_emails=21
moved_posts=2
notifications=10
post_localizations=51
post_revisions=31
post_search_data=226
posts=774
site_settings=1
stylesheet_cache=1168
Error: ERROR: duplicate key value violates unique constraint "unique_post_links"
DETAIL: Key (topic_id, post_id, url)=(581, 3696, https://digitallysovereign.org) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.
SELECT tablename
FROM pg_indexes
WHERE indexname = 'unique_post_links';
```\n
`topic_links` が返ってくるはずです?つまり、これが次の論理的なステップです:
```sql
DELETE FROM topic_links old_link
WHERE old_link.url LIKE '%discourse.tobiaseigen.org%'
AND EXISTS (
SELECT 1
FROM topic_links new_link
WHERE new_link.topic_id = old_link.topic_id
AND new_link.post_id = old_link.post_id
AND new_link.url = REPLACE(old_link.url, 'discourse.tobiaseigen.org', 'digitallysovereign.org')
);