# Global Replace across database

**URL:** <https://meta.discourse.org/t/global-replace-across-database/55930>\
**Category:** Support\
**Created:** [17 Gennaio 2017, 10:06pm UTC](https://meta.discourse.org/t/global-replace-across-database/55930 "2017-01-17T22:06:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<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:** [17 Gennaio 2017, 10:06pm UTC](https://meta.discourse.org/t/global-replace-across-database/55930/1 "2017-01-17T22:06:00Z")

</div>

On a new importer, I included a wonder feature that includes a link to the post on the original site so that it’s easy to see what the post looked like on the old system to make it easier to find problems. It’s great.

But I screwed up and did the full import (~2.3 million posts) leaving that link in the first post in every topic. I’d love to be able to strip from all those topics and not have to re-run the script from scratch.

```
\[ORIGINAL POST\]\(.*t\)

```

There was discussion [here](https://meta.discourse.org/t/replace-a-string-in-all-posts/48729) about doing that, but it doesn’t do regexes. Maybe I just want to live on the edge and do it from the console?

Something like this, but remove the `Regex.escape`?

> <https://github.com/discourse/discourse/blob/main/lib/tasks/posts.rake#L129-L140>

---

_[View the full topic](https://meta.discourse.org/t/global-replace-across-database/55930)._
