Add migration function

The db will change from mariadb to mongodb

the migration process need refine again,

now will cost too much memory