Sync Your DEVONthink Databases

If you have more than one Mac—or a Mac and one or more iOS devices—you’ll probably want to use DEVONthink on each one, and that in turn almost certainly means you’ll want your data to stay in sync across your devices. We’ve all become accustomed to near-instant syncing of data such as email, contacts, and calendars. In addition, cloud services like Dropbox and iCloud Drive enable us to keep files and folders in sync everywhere. You can now have that same experience with your DEVONthink data.

In the previous edition of this book, I described the sync capabilities DEVONthink had at that time. To put it generously, they were pretty weak (as in hard to configure, slow, and unreliable). But I’m delighted to say that DEVONtechnologies has rewritten DEVONthink’s sync engine from the ground up, and in my testing over the past few months, I’ve found it to be both speedy and dependable—a far cry from the earlier implementation. To use the new sync engine, you must have DEVONthink 2.9 or later installed.

If you were syncing using the old DEVONthink method, you’re in for a treat. Yes, you’ll have to set up everything from scratch again, but it’s easier to do so now, and the result is quite satisfying. If you’re setting up syncing for the first time, there are a few things you’ll have to know, but after the initial setup, syncing should be nearly transparent.

Understand Sync Basics

Before you jump in and set up syncing, you should be aware of the numerous choices DEVONthink offers and how they compare. It’s worth taking a few minutes to think through your options in advance in order to achieve your desired results.

External vs. Built-in Syncing

As I explained in How and Where Databases Are Stored, even though DEVONthink stores all your documents as individual files on disk, it also keeps a great deal of information in a proprietary database; the database and the files together are kept in a package—a folder that looks like a single file. Because of the way databases work, syncing is tricky and dangerous if you try to do it outside DEVONthink (for example, by using a sync app such as ChronoSync or by storing your database in Dropbox or a folder synced by a similar service). Making even a small change to a single document changes not only the corresponding document file but also various parts of the database. As a result, if the data is synced externally while the database is open in more than one place, errors and data loss could occur.

However, using DEVONthink itself to perform the syncing is another story altogether. DEVONthink can sync any or all of your databases with any number of other Macs and iOS devices, and it’s safe to make changes with the database open on more than one device—DEVONthink knows how to merge your changes quickly and intelligently.

Sync Locations

Any database can sync to one or more locations (or none); you can choose whichever combination best meets your needs. Conceptually, the various destination choices fall into two categories—direct (a database syncs between two copies of DEVONthink running on different devices) and indirect (each copy of DEVONthink syncs independently with a sync store—a copy of the database stored in central location, such as a file server or cloud service).

Each method has certain implications:

  • For direct Mac-to-Mac (or Mac-to-iOS, or iOS-to-iOS) syncing to work, DEVONthink must be running on both devices, which must also be on the same network. If this arrangement is possible, direct syncing is the fastest and most efficient option, and has the lowest risk of conflicts.
  • Indirect syncing lets any copy of DEVONthink sync at any time, without regard to whether another copy of DEVONthink is running. As long as each device can reach the sync destination, the devices need not even be on the same network. But because each Mac or iOS device syncs independently, it becomes slightly more likely that a given document could change in more than one location between syncs, resulting in a conflict (see Set Syncing Options).
  • With either method, you can sync more than two devices. However, each sync operation occurs between a single pair of locations. As a result, in order for any particular change to propagate from one device to another, two sync operations may be required (depending on the timing of the syncs).

DEVONthink uses the term location to refer to a sync endpoint, which can be another Mac or iOS device on your local network (if you’re doing a direct sync) or the cloud storage destination for your sync store (if you’re doing an indirect sync). Here are the location types you can choose, and what you should know about each:

  • Direct connection: This option lets you sync directly with a copy of DEVONthink running on another Mac or iOS device on your local network. Although the syncing is bidirectional, one device effectively acts as a server and the other(s) as client(s). You must set up a password on the server and then authenticate with that password on your other devices; this prevents unauthorized users from syncing with your databases.
  • Local sync store: The desktop versions of DEVONthink can sync a database to any folder you can navigate to in the Finder; typically, you would choose a folder on a local network server, although you could also use an external hard drive, flash drive, or other storage. After you’ve synced one copy of DEVONthink to this folder, copies running on other Macs can optionally sync with that same location. Unlike a direct connection, this requires making a separate copy of your database; on the other hand, it also permits syncing when one or more of the devices is offline.
  • Dropbox account: If you have a Dropbox account with enough free space to hold your database, you can sync to it. You can then sync your other devices to the same Dropbox account. (You can’t sync to a Dropbox folder someone else has shared with you, because DEVONthink can read and write files only in a single, specific location in your Dropbox for security reasons.) When you set up Dropbox syncing the first time, DEVONthink asks for your Dropbox credentials to authorize access. Be sure to read the sidebar ahead, Syncing with Dropbox, to understand how this works—which may not be what you expect!
  • iCloud Drive: DEVONthink can use iCloud Drive to hold your sync store, making it accessible to your other Macs. Unlike Dropbox, setting up iCloud Drive requires no additional authentication steps. Unfortunately (and counterintuitively), you can’t access a DEVONthink sync store in iCloud Drive using DEVONthink To Go on an iOS device. So if your goal is to do cloud-based syncing with both Macs and iOS devices, Dropbox is currently the best choice, though the options described in the next bullet point will also work.
  • WebDAV Server, Box, or CloudMe: You can sync your DEVONthink database to a WebDAV server on your local network or on a remote network. You’ll need to specify the server address, the path to the desired location on the server, a Store Name (the filename you want to use on the server), your username, and your password. You can also check a box to connect securely using SSL (WebDAV over HTTPS). Because the cloud storage offered by Box and CloudMe is accessible over WebDAV, you can use those as locations for a sync store, and DEVONthink even offers shortcuts to set up those services.

Regardless of how you choose to sync your databases, DEVONthink strongly encrypts your data using AES-256. For direct connections, DEVONthink encrypts the data in transit. For all indirect connections, the sync stores are encrypted as long as you enter a password when setting them up (see Configure Syncing), which I highly recommend.

Which option is best for you? That depends on numerous factors, such as the size(s) of your database(s), which services you have accounts with, and personal preference. I’ve had good results using both direct connections and Dropbox. The advantage of Dropbox is that it makes your DEVONthink databases available to iOS devices running DEVONthink To Go, and it permits syncing even when one or more of your devices is offline. As long as you have enough storage in your Dropbox account, Dropbox is the most flexible all-around choice.

Once you’ve chosen one or more sync destinations for a given database, you can optionally configure DEVONthink to sync automatically, manually, or on a recurring schedule.

Configure Syncing

Syncing is quite easy—it takes much longer to explain it than to set it up! The procedure requires three quick steps: Add a Location, Select or Import Your Database(s), and Set Syncing Options. You must go through these steps on each device you want to sync.

All the steps that follow take place in DEVONthink > Preferences > Sync, which initially looks like Figure 57.

**Figure 57:** DEVONthink’s Sync preference pane looks like this before you configure syncing.
Figure 57: DEVONthink’s Sync preference pane looks like this before you configure syncing.

Add a Location

The Locations list on the left side of the Sync preference pane shows all the locations to which you can sync DEVONthink. The list includes any Macs on your local network that are running DEVONthink and configured to accept incoming Bonjour connections and one instance each of the various other account types. (You can add more, if need be—for example, you can have multiple Dropbox accounts, multiple WebDAV accounts, and so on.)

To add a location, select its checkbox and fill in the relevant details in the dialog that appears. Each location asks for slightly different information, and in particular, the details differ significantly between direct connections (discussed next) and indirect connections such as Dropbox, iCloud Drive, and WebDAV (see Add an Indirect Connection).

Add a Direct Connection

For direct connections, there’s not even a checkbox to select until you set up one of your Macs to function as a server (see Set Bonjour Options, just ahead). However, once you’ve done so, connecting from another device requires little more than entering your password (see Connect to a Local Mac).

Direct connections are different from all the other location types in that you’re not syncing all devices to a central location; instead, one device (a Mac, for the purposes of this chapter) functions as a server and your other devices function as clients. Whichever Mac is going to be the server has to be set up before any of the clients. Syncing works the same way regardless of which Mac you choose as the server. If you have one Mac that’s on and connected to your network all the time, that one would be a better choice for a server than a Mac that spends a lot of time turned off, asleep, or offline. Other than that, the choice is pretty arbitrary.

Once you’ve chosen a Mac to function as the server, you need to set its Bonjour options (as described next). Then, on the other Macs on your network, follow the steps under Connect to a Local Mac.

Set Bonjour Options

On the Mac you want to function as a server, click Bonjour Options and fill in the dialog that appears (Figure 58).

**Figure 58:** Set up incoming connections in this dialog.
Figure 58: Set up incoming connections in this dialog.

Here are the options:

  • Enable incoming connections: Select this to permit DEVONthink on this Mac to accept connections from DEVONthink on other devices on your local network. (If this is deselected, then regardless of your other settings, this Mac cannot function as a server.)
  • Open databases automatically: Once you’ve set up syncing and selected databases from this Mac on another device (see Select or Import Your Database(s)), you might (accidentally or intentionally) close one of those databases on this Mac, which would prevent it from syncing to your other devices. To avoid that problem, select this checkbox, which permits clients to request that this Mac open any databases previously set up for syncing when a sync is required.
  • Port: This is optional. If you leave it blank, DEVONthink will pick a random, high number—and that’s fine for most users. However, if you want to use a specific port number (perhaps because of a firewall configuration on your network), enter the port number here.
  • Password: A password is mandatory; it enables DEVONthink to encrypt your data while it’s in transit over your network, and prevents eavesdropping.

After you’ve filled in a password and at least selected the first checkbox, click OK. Once you’ve done that, this Mac appears in the Locations list as an option for other Macs and iOS devices on your local network. On those devices, you can then proceed to the next topic.

Connect to a Local Mac

Once you have a server set up to receive connections, go to your next Mac, open DEVONthink > Preferences > Sync, and select the checkbox next to the first Mac’s name in the Locations list. In the Password alert that appears (Figure 59), type the password you set up on the server Mac. (You don’t even need to press Return or click OK!) That’s it—you’re connected. Proceed to Select or Import Your Database(s).

**Figure 59:** Enter the password you set up on the server Mac here.
Figure 59: Enter the password you set up on the server Mac here.
Add an Indirect Connection

For indirect connections (all locations other than direct connections), after you select the location’s checkbox in the Locations list, you’ll need to specify account and sync store settings in a dialog (Figure 60).

**Figure 60:** This dialog appears after you select New WebDAV Server in the Locations list. (Other locations display variations on this dialog with fewer controls.)
Figure 60: This dialog appears after you select New WebDAV Server in the Locations list. (Other locations display variations on this dialog with fewer controls.)

The fields and controls in this dialog vary somewhat from one location to another. You may see the following:

  • URL: For WebDAV locations only, enter the server’s full URL. (For local sync stores, in place of a URL, a Where pop-up menu appears; use this menu to select a location.)
  • Sync Store Name: The name of the sync store—that is, the package that’s stored in your Dropbox, on a local server, or wherever you choose—that serves as the central repository for syncing between this Mac and other devices. (For local sync stores, the field is labeled Save As.)

    What sort of name should you enter? Well, the sync store can hold sync data for multiple databases, so you shouldn’t name it after a particular database. It can also sync data from many devices, so you shouldn’t name it after your Mac. In fact, the only reason the name might matter is if, for some reason, you wanted to set up multiple sync stores in the same location—and that would be a highly unusual scenario. So, enter anything you like here, as long as the name doesn’t include spaces. (I named mine HomeDepot. As in, you know, a store where you can buy sinks. Because that’s how I roll.) Once you’ve set up a sync store for one device, you should enter the same name when setting up additional devices.

  • Encryption: If you want your sync store to be encrypted—and you absolutely do!—enter and verify a password in the fields provided.
  • Options: The bottom of the dialog has a series of checkboxes that let you specify sync options for this sync store:
    • Synchronize label names & colors: Syncs label names and colors (see the sidebar Using Labels and Flags) using this sync store. It’s optional because this is a global preference, not a database-specific preference, and you may want different copies of DEVONthink to use different label names or colors.
    • Synchronize database properties: Syncs settings found in the Database Properties window (described in Configure Database Properties), such as whether groups are excluded from tagging and whether the database is individually password-protected. If you deselect this option, each synced copy of the database can have different properties.
    • Synchronize content of indexed items: By default, DEVONthink syncs only the metadata for any indexed items (that is, items whose original files are not stored within your DEVONthink database). However, if you select this checkbox, DEVONthink also syncs the original files themselves, so you can view and work with them on your other devices.
    • Verify uploaded items: Select this checkbox to make DEVONthink verify the integrity of each file after it has uploaded to another device. This option, which is not available for Dropbox locations, is usually unnecessary (and increases the amount of time each sync requires), but if you experience missing or corrupted files during syncing, you can enable it to confirm that each transfer took place correctly.

Once you’ve filled in the dialog with all required information, click OK. DEVONthink copies your sync store to the location you selected.

You can then move on to Select or Import Your Database(s)unless you added a Dropbox location, in which you need to complete a few additional steps first:

  1. If your Web browser opens automatically to a sign-in page for Dropbox, enter your Dropbox username and password, and click Sign In. (If your browser does not open automatically, skip to Step 5.)
  2. If you have Dropbox’s two-factor authentication enabled (always a good idea!), you’ll be prompted to enter your authentication code. Do so and click Submit.
  3. Click Allow to give DEVONthink access to its own folder (and no other folders) in your Dropbox.
  4. When you see a Web page that says “Success! DEVONthink Sync is connected to your Dropbox,” you can close your browser window or tab.

    At this point, DEVONthink begins copying your sync store to Dropbox, but you aren’t done yet. I strongly recommend that you use Dropbox’s Selective Sync feature to avoid storing a local copy of the synced data, as I described in the sidebar Syncing with Dropbox. To do this, continue with the remaining steps.

  5. Go to the Dropbox menu on the menu bar.
  6. Click the gear icon, and choose Preferences from the pop-up menu.
  7. Click Account, followed by Change Settings (next to Selective Sync).
  8. Navigate to Apps and deselect the DEVONthink Packet Sync checkbox (Figure 61).
    **Figure 61:** Deselect the DEVONthink Packet Sync checkbox to avoid making a duplicate copy of your sync data on your Mac.
    Figure 61: Deselect the DEVONthink Packet Sync checkbox to avoid making a duplicate copy of your sync data on your Mac.
  9. Click Update.

Dropbox may take several minutes to remove the local copy of that folder.

Note that even though this procedure removes the sync folder from your Mac, it’s still stored on the Dropbox servers, so you’ll need to be sure you have enough storage space in your account to hold it. And, you’ll have to repeat this procedure on each of your Macs.

Select or Import Your Database(s)

Now that you have a location (or more than one) configured, you must next determine which databases will sync to that location. You can sync all your databases to the same location, or each to a different one, or certain databases to each of several locations—whatever you like. The most common case is to sync any given database to just one location.

With your location selected in the Locations list on the left, look in the Databases list on the right. (Figure 62 shows the list as it might appear for a direct connection.)

**Figure 62:** With a location selected (that is, not just checked, but also highlighted) on the left, select which databases to sync with that location on the right.
Figure 62: With a location selected (that is, not just checked, but also highlighted) on the left, select which databases to sync with that location on the right.

The LOCAL portion of the Databases list contains the databases currently open on this Mac; the REMOTE portion contains databases open on the other Mac (in the case of direct connections) or in the sync store (for indirect connections) that do not already exist on this Mac. (If you previously synced a database between these two Macs in some other way—using file sharing, an external sync utility, or the previous version of DEVONthink’s syncing capability, for example—and it’s open on both Macs, it appears in the LOCAL section.)

Sync a Local Database

To sync a database in the LOCAL category, simply select its checkbox. If the location is anything but a direct connection, DEVONthink immediately begins uploading your data to the sync store (or, if the database already exists in the sync store, merging it).

Sync a Remote Database

To sync a database in the REMOTE category, you must import it, thus creating a local copy. To do so, select the database in the Databases list and click the Import button below the Databases list (or choose Import Database from the Actions pop-up menu). Then enter a name for the local copy of the database, navigate to where you want it to be stored, and click Create. DEVONthink imports the database, enables syncing, and begins the sync process immediately.

Use Additional Sync Controls

Under the Databases list are two additional icons you may find useful:

  • Sync now: Click the Force Sync button to force an immediate sync, if syncing is not set to Automatic (see just ahead).
  • Refresh: If the list of databases on this Mac, on the remote Mac, or in the sync store changed recently and the current selections don’t appear here, click the Refresh button to refresh the view.

Set Syncing Options

The final three syncing options can be set at any time (even before setting up locations and databases, if you prefer). These settings, found at the bottom of the Sync preference pane, apply to all locations and databases:

  • Synchronize: When this pop-up menu is set to Automatic, the default, DEVONthink watches for changes in both remote and local copies of each database and syncs them with the other location almost immediately after they occur. If you prefer to sync on a fixed schedule, you can instead choose Every 5 Minutes, Every 15 Minutes, Every 30 Minutes, or Hourly from this menu. Or choose Manually to sync only when you Click the Force Sync button.
  • Max. Connections: DEVONthink can open up to 16 multiple, simultaneous connections to any location (8 for Dropbox and Box), enabling it to copy multiple documents at the same time. If you suspect that DEVONthink is slowing down your network because it has too many connections active, you can reduce this number.
  • Conflicts: If a document changes both locally and remotely between syncs (a rare occurrence when Synchronize is set to Automatic and you have a fast network connection), this set of controls determines what will happen. If you select “Use latest document,” the more recently changed document will overwrite the older one. If you select “Duplicate documents,” both copies sync in both directions—preventing data loss, but forcing you to manually sort out, later on, which version of each document you want.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.148.180