Import: Alte Post-IDs in Discourse beibehalten

The import script saves the import id in a post custom field. You can use it to create permalinks. Several importers do that. You can look at others for examples.