How to Backup and Restore Hookmark Data

There are several ways to backup Hookmark data and restore it on the same or different Macs.

Some rules:

  1. Make sure that the Mac to which you are restoring Hookmark’s Application Support folder , i.e., ~/Library/Application Support/com.cogsciapps.hook uses a version of Hookmark that is the same or newer than the source Mac.
  2. Before backing up or restoring Hookmark’s Application Support folder, exit Hookmark on the Mac(s).
  3. Ensure that Hookmark’s Application Support folder (~/Library/Application Support/com.cogsciapps.hook) is migrated in its entirety in a way that preserves its files’ macOS Finder extended file attributes (xattr). The methods described below achieve this.

The most common ways of backing up and restoring Hookmark data are:

These methods are described below.

Where does Hookmark store its data?

First, consider where Hookmark data is stored.

  1. Hookmark stores its bookmarks (hooks and links) in the ~/Library/Application Support/com.cogsciapps.hook folder.
  2. Hookmark also has a preferences file: ~/Library/Preferences/com.cogsciapps.hook.plist.
  3. Hookmark also creates a ~/Documents/Hook folder, which contains Hookmark templates and notes created with Hookmark.
  4. At your request, Hookmark can create .hook files, which by default are stored in the ~/Documents/Hook/Hook Files folder. You can move Hookmark files wherever you want.

Hookmark’s automatic backups

You can restore Hookmark to a prior state by following the steps in this section.

As of Hookmark 5.0, Hookmark automatically backs up its database in its ~/Library/Application\ Support/com.cogsciapps.hook/backups folder (Setapp: ~/Library/Application Support/com.cogsciapps.hook-setapp/backups).

If you would like to revert Hookmark to a previous state, you can

  1. quit Hookmark
  2. copy the hook.sqlite file from that folder to a backup location
  3. replace the hook.sqlite with one of the files in the backups
  4. relaunch Hookmark

Time Machine and Migration Assistant

If you enable Time Machine on the source Mac, then you can restore a previous version of Hookmark’s data in the way you would with any other app. Similarly, you can use Migration Assistant as you would with any other app. You can then restore your data on the same Mac or a different Mac.

Clone or ditto

You may alternatively backup and restore Hookmark data by using cloning software, such as Carbon Copy Cloner or Super Duper. You may also use ditto from the command line to backup and restore Hookmark data.

Zipping and unzipping Hookmark’s library folder

You may also zip the content of Hookmark’s ~/Library/Application Support/com.cogsciapps.hook folder. To restore Hookmark on the same or a different Mac, unzip this folder on the target machine.

Accessing files by their links after restoring from a backup

When you use Copy Link on an item, Hookmark returns a link containing a URL (an address). Often, the URL of the file will match the app’s “scheme”. For example, in OmniFocus you get OmniFocus:/// URLs. In web browsers you often get https://. When you copy a link to a file (accessible from Finder), Hookmark typically copies a URL of the form hook://file//. These links are known as “Hookmark file-URLs” or “Hookmark file-links”. (These file links are not to to be confused with “.hookmark” files, which can contain links to anything, including to files).

After you restore your Hookmark data, in order for Hookmark (or any other app) to be able to reach the target of any link, its target must be reachable from the target Mac. For example, if you have links to OmniFocus tasks, those links will only be reachable if OmniFocus is installed on the target Mac and the same OmniFocus database is available there too. So you will need to restore those targets, too, if you want to continue to be able to access them with Hookmark.

Similarly, if pre-backup, you created links to files (hook://file//), those files must still be accessible for the links to be used. If the files are remounted in the same location as they were when you last used Hookmark, then Hookmark will point to them at that location.

If you happen to not remount the target files in the original location (path) and mount them at a different location instead, then Hookmark will attempt to find the targets of your links elsewhere. (This is part of what we mean when we say that Hookmark links are robust.) If in this case you have multiple copies of the target Hookmark files, Hookmark will only choose one target per link. (If that target disappears, Hookmark will attempt to re-anchor the link.)

See also

See also: