Add onsite 'migrate' function for scaffolding feature & minor code refactor

1. add migrate to scaffolding
2. code refactoring
3. polish help messages