Issue #2160345 by chx, YesCT, andypost: Clean up and test migrate executable and sql idmap.