fix replication when remote db is not available, continue rewrite of migration task