improve management scripts and add build-in migration support