# Rebake and Oneboxes confusion

**URL:** <https://meta.discourse.org/t/rebake-and-oneboxes-confusion/248167>\
**Category:** Product Support\
**Tags:** rails-console\
**Created:** [December 7, 2022, 2:55pm UTC](https://meta.discourse.org/t/rebake-and-oneboxes-confusion/248167 "2022-12-07T14:55:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)\
**Post date:** [December 7, 2022, 2:55pm UTC](https://meta.discourse.org/t/rebake-and-oneboxes-confusion/248167/1 "2022-12-07T14:55:26Z")

</div>

Hi there, on my testbed migration from Drupal I ran a bunch of `regexp_replace` commands from the Postegres console, requiring a rebake of all the posts. So for the past \>12 hours I have `rake posts:rebake` still crunching through almost 2M posts. I checked out one of the topics that already got rebaked and I noticed that Oneboxes aren’t displaying unless I manually edit the post ( **Rebuild HTML** doesn’t help). So if I understand correctly it appears that I’m going to have to spend another 20 hours to run `rake posts:refresh_oneboxes` ? That command also echoes: `Rebaking post markdown for 'default'"` , which makes me think that I could have killed two birds with one stone by initially running just `refresh_oneboxes` to refresh the Oneboxes and also rebuild the post HTML after the regexp replacements?

It looks like I could alternatively run this in `rails c` :

```plaintext
Post.find_each do |p|
    p.rebake!(invalidate_oneboxes: true)
    p.save ###Needed?
end

```

Would that be any faster than the `rake` command?

Also, while on this subject I’d like to understand when I also need to use `p.save` in the Rails console, would it be needed for the above process?

Thanks a lot!

---

_[View the full topic](https://meta.discourse.org/t/rebake-and-oneboxes-confusion/248167)._
