tidy up migration script.
fix typo
create cli script for migration