I do appreciate the information on the Notes location on Mac. Respectfully though, I have a problem with step 4. I have several hundred notes, including attachments, such as images, links, PDF files. The notes are stored across numerous folders. Copying all this manually into another application, especially given various formats of the attachments, is simply impractical.
Is that all we can expect from Mac software/ecosystem, with all the feature glitz and push to the "seamless cloud", to resort to manual copy/paste workaround while disconnected from Internet? What is the point of having a backup, especially TimeMachine, if an average user can't easily run an intuitive restore operation?
Also, speaking of your point on how to prevent an immediate deletion of a restored Notes database. Would the following sequence work:
1. Disable Notes in iCloud Preferences, thus deleting them across all devices for the account, including the iCloud
2. Restore the database files, per your recommendation above
3. Enable Notes in the iCloud, thus inducing it to sync across the iCloud. I assume Apple programming geniuses included a provision in the software to check for an existing Notes database, and to give precedence across an empty or uninitialized iCloud Notes and consequently on the rest of the devices for the given account.
If this doesn't work, then maybe the following sequence would do it:
1. Disable Notes in iCloud Preferences, thus deleting them across all devices for the account, including the iCloud
2. Restore the database files, per your recommendation above
3. Move the entire folder/notes hierarchy from the iCloud account within Notes to the local On My Mac account.
4. Enable Notes in the iCloud Preferences. The sync would not affect On My Mac account because it's local not iCloud.
5. Move the folder/notes hierarchy back to the iCloud account within Notes. Subsequent sync should override the empty database on iCloud.
I have not tried all of this because until reading your post I didn't know the location of the Notes database. To be honest, even now I am not sure I have the nerve to experiment with all that. I am concerned that if I break it I would not be able to restore it properly.
Please advise on all that. It would be greatly appreciated.