Added migrate function  to migrate and test prepare