Xenforo Import: Pre-existing Topic & Post ids

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.