How to migrate master and keep slave in sync?