move migrate task to lib