If Apple Notes stop syncing

Has it ever happened to you that Apple’s Notes just stopped syncing reliably via iCloud?

For me it happens like this: the Mac stops uploading local changes to some notes to iCloud, so I don’t see them on my phone. I know that the problem is really in uploading from the Mac because the web version of iCloud continues to sync normally with my iPhone. Also, the new notes that I create on the phone, appear on my Mac.

You may have found several fix suggestions online, most futile. Signing off iCloud and then signing back on helps, but this way you lose all the local changes that haven’t been uploaded to iCloud.

What I’ve found to be a working and safe solution is to select the “All iCloud” folder in Notes, then sort notes by date changed, then move all the notes that hadn’t been uploaded to iCloud to the “On My Mac” account (you must enable it in Preferences) and then move them back to the iCloud account.

Next