When we migrated away from JIRA, we scripted it such that the JIRA issue numbers were recorded in the newly migrated issues exactly because of things like this.
Having migrated bug systems for very large, very old code bases before, it's pretty easy to make the URls and links like this still go to the right place.
This is actually the least difficult thing, i would say ;)