migrate sync and peer functions.