Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mortenjust/8ec7b20817980ab5f0cc to your computer and use it in GitHub Desktop.
Save mortenjust/8ec7b20817980ab5f0cc to your computer and use it in GitHub Desktop.

1. Create a folder in Dropbox or Google Drive

We'll use ~/Dropbox/Macnotes in this example

2. Copy the notes folder to the new folder in Dropbox or Google Drive

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.

3. Create the link

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.

5. Test the backup

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)

Restore the backup

You got a new Mac. To get all your notes back, do step 3.

@MayurSadavarte
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment