legacy_ids function

Convert current IDs to legacy IDs