I've also had to do this a couple of times.
A simple way is to disable your board (I'll explain just why in a minute) and run an SQL which will insert the topics, post_text and posts that were missing.
If you don't disable your board and you've manually inserted the topic, then the post and before the post_text is saved sombody clicks to open that topic, the board will find that the topic is empty and the topic and post entries will be deleted from the tables. So you'll end up with a post_text with no post and no topic.
So my advice: Make the SQL file, disable the board, run the SQL, enable your board.
Just one remark: if those topics were in a forum which was deleted since then, you will also have to restire that forum.
My board's not broken, it just went peculiar