# Remap error when a post contains a quote from another topic

**URL:** https://meta.discourse.org/t/remap-error-when-a-post-contains-a-quote-from-another-topic/285950
**Category:** Bug
**Created:** [November 18, 2023, 10:49pm UTC](https://meta.discourse.org/t/remap-error-when-a-post-contains-a-quote-from-another-topic/285950 "2023-11-18T22:49:42Z")
**Posts on this page:** 1
**Page:** 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: [November 18, 2023, 10:49pm UTC](https://meta.discourse.org/t/remap-error-when-a-post-contains-a-quote-from-another-topic/285950/1 "2023-11-18T22:49:42Z")

</div>

When I enter a remap command as per [Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-your-discourse/16098), I’m getting this error whenever a topic contains a quote from another topic:

> Error: ERROR: duplicate key value violates unique constraint “unique\_post\_links”  
> DETAIL: Key (topic\_id, post\_id, url)=(265, 33103, [https://my.forum.url/t/my-topic-name/2025/35](https://my.forum.url/t/my-topic-name/2025/35)) already exists.  
> The remap has only been partially applied due to the error above. Please re-run the script again.

This situation occurs when posts containing a quote are split off into a different topic, or if they have been deliberately made.

If I permanently delete the offending topic or remove the quote reference manually, it is all good. But that isn’t really feasible.
