Xenforo Import: Pre-existing Topic & Post ids

Hi Folks,

Have an exisitng Xenforo forum with roughly quarter million posts.

Few days ago I trialled an import into Discourse.

First off congrats to all who’ve worked on the script, was one of the most trouble free imports from one forum software to another that I’ve undertaken.

That said I have a couple of questions.

I’ll preface this by saying that Ruby isn’t my natural habitat by a long shot, so it’s entirely likely there’s some translation issues here and I’ve missed something obvious. Apologies if that’s the case.

I’m looking to see if during (or even after) the import, the topic/post ids from the previous forum (in this case xenforo) are stored anywhere or linked in any way to the new discourse ids.

In my searching I saw some mention of it for Vbulletin and reading the XF (and eventually base) import script I see it import_ids referred to fairly frequently but they all seem to be emphemeral vars used during the import process then discarded (although as I said no expert at Ruby so might be getting that horribly wrong)

My forum has been around for quite some time and has gone few a few iterations, PunBB, IPS, VB and now Xenforo, but most of the time I’ve been able to keep links to old threads etc active through a few simple custom scripts. (of course that simplicity there was offset by most of those migrations being far more painful ;)) I’d like to do the same here except I’m lacking some sort of mapping from old topic to new or a DB field referencing the old topic id.

At least I think I am, it might be there but I can’t seem to find it :slight_smile:

Happy to contribute what I come up with back to the masses at large just need some street signs pointing me in the right direction.


1 Like

The old IDs are in PostCustomFields and are created as part of the importer.

You can have a look at other importers that create Permalinks. The Vbulletin one is an example. The other thing you’ll want to take note of is “permalink normalizations”, a regex that is applied before permalink matching is done. That lets you do stuff like create a permalink like '/oldtopic/<topic_id>" that you can make match /topic/blah.php?xdfj=<topic_id>#93m3lsdfj with a regex.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.