# Trouble with \`discourse remap\` remapping \`topic\_links url\`

**URL:** https://meta.discourse.org/t/trouble-with-discourse-remap-remapping-topic-links-url/110052
**Category:** Bug
**Created:** [February 25, 2019, 5:31pm UTC](https://meta.discourse.org/t/trouble-with-discourse-remap-remapping-topic-links-url/110052 "2019-02-25T17:31:20Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 28, 2019, 5:09pm UTC](https://meta.discourse.org/t/trouble-with-discourse-remap-remapping-topic-links-url/110052/8 "2019-02-28T17:09:22Z")

</div>

I’ll give that a shot. My solution was to add a `next if parsed.length > 500` to `self.extract_from(post) in `topic\_link.rb`. It seems like that would fix it for everyone. I think that it worked on the site where I am doing the remapping, but then I’m getting

```plaintext
Error: ERROR: duplicate key value violates unique constraint "unique_post_links"
DETAIL: Key (topic_id, post_id, url)=(19484, 61049, https://staging.community.rstudio.com/t/birds-of-a-feather-bof-at-rstudio-conf-2019l/19328) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.

```

More on this over at [Migrate\_to\_s3 for Digital Ocean Spaces woes - #12 by pfaffman](https://meta.discourse.org/t/migrate-to-s3-for-digital-ocean-spaces-woes/109662/12). I hit the same `topic_link` problem doing the S3 migrate on another site.

---

_[View the full topic](https://meta.discourse.org/t/trouble-with-discourse-remap-remapping-topic-links-url/110052)._
