match existing field ids with imported field ids

fixes issues #2212, #1721, #2167, #881