# Batch processing to search and replace in all posts

**URL:** <https://meta.discourse.org/t/batch-processing-to-search-and-replace-in-all-posts/33621>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [22 Septiembre, 2015 23:56 UTC](https://meta.discourse.org/t/batch-processing-to-search-and-replace-in-all-posts/33621 "2015-09-22T23:56:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)\
**Post date:** [23 Septiembre, 2015 01:23 UTC](https://meta.discourse.org/t/batch-processing-to-search-and-replace-in-all-posts/33621/3 "2015-09-23T01:23:02Z")

</div>

[remap](https://github.com/discourse/discourse/blob/master/script/discourse#L143) does a search and replace on text and char columns across all tables - a little rough of a tool. Also, how would the `raw` → `cooked` conversion be handled?

Is there a higher-level way of altering and rebaking posts, that would take into account things like re-computing excerpts, [quoted posts](https://github.com/discourse/discourse/blob/9ce66038647bc4ff63167fe9c74857a01acc0875/app/models/post.rb#L453) and [reply relationships](https://github.com/discourse/discourse/blob/9ce66038647bc4ff63167fe9c74857a01acc0875/app/models/post.rb#L469)? The latter are especially important when fixing the quote line after the import.

---

_[View the full topic](https://meta.discourse.org/t/batch-processing-to-search-and-replace-in-all-posts/33621)._
