Script migrate improved