We'll use ~/Dropbox/Macnotes
in this example
We'll use Finder for this instead of terminal as the cp -r
command also copies the contents of all aliases and the Notes folder has a lot of those.
Quit notes
Open terminal and enable hidden files in Finder:
defaults write com.apple.finder AppleShowAllFiles YES.
Open Finder, press Cmd+shift+g
, then paste in ~/Library/Containers/
Find the com.apple.Notes
folder and drag it to your Dropbox folder (or a subfolder). This will remove it from the Containers
folder.
cd ~/Library/Containers/
ln -s ~/Dropbox/backup/Macnotes/com.apple.Notes ~/Library/Containers/com.apple.Notes
4. Disable hidden files in Finder (if you want)
defaults write com.apple.finder AppleShowAllFiles NO.
Type something in a note in the Mac Notes app, look at the Dropbox icon and check that it is updating. To double check, go to the web file browser. To triple check, buy a new mac and see if your notes sync over (or just delete the folder and restore it)
You got a new Mac. To get all your notes back, do step 3.
This does NOT work. Supposedly there is another folder called 'Group Containers' which Notes uses to keep its state. Just backing up 'Containers' is not enough.