Specifically, I'm interested in all questions migrated from SO to OpenSource.SE and Programmers.SE to find a specific one.
You want to inspect the
posthistory table for that, specially the rows for posthistorytypeid's 35 (away) and 36 (here), the comment field on those rows hold the original url
Your query would look like this:
select postid as [Post Link] , creationdate , posthistorytypeid , case when posthistorytypeid = 35 then 'Migrated Away' when posthistorytypeid = 36 then 'Migrated Here' end , comment from posthistory where postid = 36025884
which results in:
Keep in mind that post stubs will be deleted over time (60 days IIRC) so you won't find the migration history of all posts.