# Splitting large topics

**URL:** https://meta.discourse.org/t/splitting-large-topics/119588
**Category:** Development
**Created:** [June 5, 2019, 3:45pm UTC](https://meta.discourse.org/t/splitting-large-topics/119588 "2019-06-05T15:45:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [June 5, 2019, 3:45pm UTC](https://meta.discourse.org/t/splitting-large-topics/119588/1 "2019-06-05T15:45:14Z")

</div>

We have a forum with a number of very large topics which we need to split into multiple smaller topics.

What would be the best way to approach that programatically?

Would it work to just load each post, change the `post_number` and `topic_id`, and save it ?  
Or would we run into issues with all kinds of counters, statistics, and links?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 5, 2019, 3:50pm UTC](https://meta.discourse.org/t/splitting-large-topics/119588/2 "2019-06-05T15:50:29Z")

</div>

I believe @zogstrip may be able to advise?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [June 6, 2019, 9:27am UTC](https://meta.discourse.org/t/splitting-large-topics/119588/3 "2019-06-06T09:27:00Z")

</div>

If this is on a live forum, I would highly recommend that you use the same high-level API that the topics controller uses when an user is moving posts to another topic.

> <https://github.com/discourse/discourse/blob/c131903e56227ce76f649cc24d327f640ae843e7/app/controllers/topics_controller.rb#L669-L691>
