Codebook's Sync feature in standard operation will exchange all changes with another device or cloud service. When there are conflicts (two records that were both changed on two different devices), the most recent change is accepted as authoritative. However, there are some scenarios where it can be useful to change how Sync operates. This can be done by selecting one of the Advanced Sync Options from the Sync menu.
Note: Changing how Sync operates is a potentially destructive operation. Please contact our support team before using this feature.
The available operations are:
We use the following terms to assist in the discussion that follows:
strip.db
file that is the main database for the local Codebook instance.This is the standard Codebook exchange operation, where previously unseen Local and Remote changes are exchanged and applied accordingly.
The purpose of the Overwrite operation is to wipe the data from a Remote and re-establish a brand new changeset using the Local data as a baseline. This is intended to let a Local Codebook instance "replace" potentially corrupt or incorrect data in the Remote with Local's known-good data. During Overwrite, all data on the Remote is removed (although the Remote database structure and Sync Key are left in place during WiFi sync). The remote is then treated like a "new" Remote that Codebook hasn't synced with previously: all local data is written to a changeset and sent to the remote.
The purpose of the Restore operation is to purge a Local Database which contains some corrupted or incorrect data, replacing it with the known-good data on the Remote. All Local data (categories, entries, fields, and labels) is deleted from the tables of the Local Database along with all change tracking information (the database structure itself along with the Sync Key are retained). Changeset data from the Remote is then replayed on the Local Database, creating a new instance of everything that had been on the Remote.
Note: Because one side is essentially clearing out the data on the other, Overwrite and Restore should be used carefully to avoid unintentional data loss.
The Merge operation allows you to combine both the Local and Remote databases to create a new, consolidated set of records. An important aspect of the Merge operation is that it does not process any deletes that have not already been synced. In other words, merging two databases will not delete data that exists in only one of the databases.
Use of this operation requires you to choose either the Local or the Remote database as the primary Conflict Authority for any conflicts Codebook cannot resolve on its own. When you select the Merge operation, Codebook will prompt you to make this choice. For any records that are conflicted and have the same updated_at
audit timestamp, the winner is chosen according to the user's choice of Conflict Authority (either Local, or Remote). For records that exist in both source databases with different updated_at
fields, conflicts will be resolved by the standard conflict handler (last update wins).