I had this problem as well. I solved it simply like this:
When the world is created, I initialize a portal list with following properties:
- source site, source level
- source x, y
- portal type (normal stairs, teleporter, one-way teleporter, hole in the ground etc.)
- destination site, destination level
- destination x, y
All portals are in that list. Only one level is generated at a time. When I create a level, the list is checked for needed portals, they're created on the map and the missing properties (x,y mainly) is filled. When the player uses a portal, the list is again checked for destination site and level. Then the destination level is created, needed portals are added on the map and x,y information is filled.