debug function of migrate