This should definitely Help
THE PROBLEM
This is one of the most sought answers for Mac users. I didn't find any of the answers attempting to solve directly. Neither did I want to use some third-party apps.
Also, when we have fewer notes, maybe, we can copy-paste but what if our whole learnings/sample codes and many more things are there in notes?
Also, copy-paste doesn't take care of many things, for example, date on while it was created maintains the order or notes, those metadata will be simply lost if you copy-paste.
Secondary, If you try to copy-paste the notes from the location it is stored, it's not guaranteed, that your backup will definitely work. maybe you copied the wrong directory, or maybe notes on newer a Mac/different system doesn't work. We can take that risk.
THE SOLUTION
This solution goes through iCloud.
Don't worry, this is the fastest and reliable solution, and will work for almost all of your cases. The setup won't take more than 5 mins.
- You definitely might be having iCloud account. if not go to System Preferences > iCloud > Create Apple ID.

- Then, Login into the iCloud account.
- Then, Open Notes app. Go to Notes > Preference. Change default account to iCloud
There may be chances that you don't see you iCloud account in Notes.
- So, for that Open Mail app.
- Go to mail > preference > account and activate the iCloud account.
- Now, go to Notes app, and you should see
iCloud
in folder pane in left side.
Wait, there are chances that you still don't see the iCloud
in notes app. That's the issue.
- Then, you can try logging out of iCloud from iCloud in System Preferences.
- Go to
Mail
app.
- Now, try signing into it by providing your icloud email and password.
- As soon as you enter correct credetnials and is verified, you will get this pop up,

- Here you, make sure to check the checkbox
Notes
.
- Then, click proceed.
- Now restart Notes app.
- You will see
iCloud
in left pane where all folders are there.
Now, main part:
- You have to create a folder in
iCloud
in Notes, with the same name for notes folders that you have in On My Mac
.
- Go the the Notes folder and in click on any note in second column.
Then press
Command+A
for select all. and then, right click > Move to > iCloud > <same_folder_name>.
- Repeat, the same for all you local folders in Mac Notes.
- Done.