Codebook Sync

Codebook's Sync feature allows you to make changes to your Codebook records on multiple devices and keep them all up-to-date. It's a multi-master, bi-directional sync system that runs on-demand. It does not require you to sync with a cloud service, but that feature is available. Codebook's Desktop WiFi service allows you to sync between mobile and desktop devices on your local network. Codebook's Sync feature is decentralized, your data is not automatically uploaded to any cloud service that we run.

You need to perform a few one-time steps to setup Sync: creating a Sync Key, and specifying your Sync preferences. After your preferences are set, all you need to do is start the Sync process to sync your data.

Note: When you sync Codebook with another device or a cloud service, you are effectively creating a backup of your data that can be used later to restore from data loss.

Codebook supports four different sync services:

  • Desktop WiFi
  • Dropbox
  • Google Drive
  • Local Folder (macOS and Windows only)

The Desktop WiFi service lets you sync Codebook on a mobile device (e.g. Android, iPhone) with Codebook on a Mac or Windows PC over your local WiFi network. When Codebook is running and unlocked on the desktop it starts up a sync service (when enabled, in Preferences) and listens for connections from Codebook on your mobile device. Launch Codebook on the mobile device and use the Sync view to initiate sync with the desktop.

The Desktop WiFi service uses port 57419. Your data is encrypted with your Sync Key over the network.

Directly syncing desktop-to-desktop and mobile-to-mobile over WiFi is not currently supported.

Dropbox and Google Drive Sync allow you to sync Codebook with your cloud service, which can be a convenient way to keep multiple devices in sync. When you sync with either service Codebook will setup and use a folder on the cloud service named Zetetic. It contains encrypted metadata and change-set files, encrypted portions of your data. The files in this folder are SQLCipher databases, encrypted with your Sync Key, and they allow another copy of Codebook to sync with the same account and replicate your data onto a new device, along with any changes.

Each copy of Codebook must sync separately and to the same cloud account for all of your devices to contain all of your changes. For example, suppose you have a desktop and a mobile copy of Codebook and they are both setup to sync with the same Dropbox account. When you sync from your desktop copy, changes you have made since your last sync will be stored on your cloud account and changes from your mobile copy of Codebook that have been synced will be made on the the desktop copy. Your mobile device will need to be synced for it to contain the updates from your desktop device.

Note: Though the files Codebook stores in your Dropbox or Google Drive have the file extension .db, you will not be able to double-click to open them on your desktop.

Codebook for macOS and Windows supports an additional sync service called Local Folder. Like the name implies, it allows you to select any folder (that you have write access to) on your local machine and Codebook will use that as a sync endpoint. When you start a sync with Local Folder, Codebook will set that folder up as an encrypted remote similar to how it works with Dropbox and Google Drive. This is particularly useful with folders mounted over the network.

  1. Setup your Sync Key.

    You create one Sync Key which is used for all of your devices. This may have been done when you installed Codebook. You create your Sync Key on one device and then copy it to your other devices by scanning a Codebook generated QR code (directly from another device running Codebook or from a printed Backup Copy) or entering a Backup Word List which is also generated in Codebook.

    For detailed instructions to on how to create a Sync Key see Setup Your Sync Key.

    For detailed instructions for adding a Sync Key to another device see Copy Sync Key.

  2. Set Sync Preferences

    On macOS

    1. Open the Codebook Preferences window. Codebook -> Preferences.
    2. Select the Sync tab on the Preferences window.
    3. Check the Enable Sync box.
    4. Select sync method: Desktop WiFi, Dropbox, Google Drive or Local Folder Sync.

      mac preferences screen

    On Windows

    1. Open the Codebook Preferences window, select the File menu -> Preferences.
    2. Select the Sync tab on the Preferences window.
    3. Select sync method: Desktop WiFi, Dropbox, Google Drive or Local Folder Sync.
    4. Click Ok

      windows preference screen

    On iOS

    1. Open the Codebook Sync screen. Tap More -> Sync.

      ios settings screen

    2. Set the Mode:

      • Tap Mode
      • Tap Desktop WiFi or Dropbox or Google Drive

        ios sync set mode screen ios sync set type screen

    3. Set Computer or Account:

      • For Desktop WiFi:

        1. Tap Computer to Browse Network.
        2. Select the network from those that are displayed. (This must match the network being used on the desktop.)

          ios sync wifi screen ios sync local network screen

      • For Dropbox or Google Drive - Tap Account to Authorize the use of your Dropbox or Google Drive Account.

        1. Tap Account to connect.
        2. Enter your cloud service account information and authorize Codebook to access your account.

          ios sync google drive screen

    On Android

    1. Open the Codebook Sync screen. Tap Home -> Sync
    2. Set the Mode:

      • Tap Mode
      • Tap Desktop WiFi or Dropbox or Google Drive

        android sync screen android sync wifi sync screen android sync selector screen

    3. Set Computer or Account:

      • For Desktop WiFi - Tap Computer to select the Network (This must match the Network being used on the desktop.)

        android sync wifi computer sync screen android sync wifi network screen

      • For Dropbox or Google Drive - Tap Account to connect your Dropbox or Google Drive Account

        android sync wifi google drive sync screen android sync cloud authorize screen

Used to Sync a mobile device with a desktop.

  1. Open Codebook and leave it running and signed in on your Mac or Windows computer
  2. Launch Codebook on your iOS or Android device, and go to the Sync view:
  3. Ensure Mode is set to WiFi, and the Computer row matches the local same local network that is being used by your desktop - Tap Start

If your desktop does not show up in the network browser, or sync is interrupted due to network problems, we’ve got some tips for troubleshooting.

On macOS

There are two ways to start the Sync process:

    1. Select the Sync Menu
    2. Click Start Sync.

  1. Click the Sync button from the Codebook toolbar.

On Windows

There are two ways to start the Sync process:

    1. Select the Sync Menu
    2. Click Sync with (cloud service).

  1. Click the Sync button from the Codebook toolbar.

On iOS

  1. Open the Codebook Sync screen. Tap More -> Sync
  2. Tap Start in the upper right hand corner

On Android

  1. Open the Codebook Sync screen. Tap Home -> Sync
  2. Tap the Sync symbol in the upper right hand corner.

You may be prompted to sign in to your Dropbox or Google Drive account if you have not already done so from within Codebook.

Updates you have made on this device will be stored in the cloud service and Codebook changes made on another device that have already been synced with this service will be reflected on this device.

Because Codebook Sync allows you to exchange all changes to your data with every device you use, it has to employ a conflict resolution strategy for situations where multiple devices have changes to the same piece of data. Codebook resolves such conflicts by choosing to persist the most recent edit. For example, if you change the same Password on two different devices and then run Sync, you will find that both devices will end up with a value for that Password field that corresponds to whichever one was edited last.

More information about how Codebook Sync replication works is available.