Splitting large topics

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?

I believe @zogstrip may be able to advise?

1 Like

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

5 Likes