Having explained how to identify the items and how to find out what to sync, the only thing left is to explain how an actual data sync process takes place:
A client connects to a server.
The client sends all its changed data to the server for processing.
The server applies the changes and sends back all other changes since the last sync, with new UIDs for new entries.
The client applies the changes and sends back a mapping table for those UIDs it could take accept for some reason.