Importing from Vanilla Forums results in out-of-order replies. Re-index Replies?

I have successfully imported an export from Vanilla Forum, but the replies in some Topics are not in the correct order. Sometimes by days, sometimes by years.

The problem appears to be that Vanilla Porter is simply exporting the replies out of order, with no discernable pattern. Then, when the Discourse import script goes line-by-line and puts the record in its appropriate place, the replies receive an out-of-order ID.

I see two possible options:

  1. Somehow fix Vanilla Porter
  2. Re-index the replies within the Discourse database based on their Create Date

#2 seems like it would be easier to do, if at all possible.

Any suggestions?

i would log into the cmd line, enter the container and rebake all the post and see if that works

cd /var/discourse
./launcher enter app
rake posts:rebake
1 Like

I think there’s a specific rake task - rake posts:reorder_posts

3 Likes

If the rake task mentioned above doesn’t do it, then what I would do next is to adjust the query that the import script uses to see that the posts are imported on order.

3 Likes

Thanks all! We got it to work. I don’t have command line access, so I’m just waiting for confirmation from the guy who does to see which command he used. I’ll update this thread when I get that.

3 Likes

He was pretty vague, but said he used both commands. So, if anyone needs to do this in the future, give both a try. Sorry I couldn’t be more specific. Thanks for the prompt assistance, folks!

1 Like

The rebake task shouldn’t be necessary, that deals with the contents of the posts which don’t need to change when reordering them.

4 Likes

So just rake posts:reorder_posts should do the job?

As long as the posts not being in chronological order is the only issue, yep. The posts:reorder_posts task will deal with exactly that and nothing else.

1 Like

Perfect, thanks for the clarification! Hope this helps someone else in the future.

1 Like