Mig maxpertype

Backend changes for stopping migration at maxId