Before migrate hook