It opens from File › Archive health…, or with a right click on All games. As soon as it opens, it checks the whole archive: even with millions of games it is a matter of a few seconds.

The figures

GamesHow many are in the archive.
Numbers left by deleted gamesEvery game has a number, and a deleted game does not give it back.
Search blocksThe files used to search by position; in brackets, how many would be needed.
Blocks less than half fullThose emptied by deletions.
DatabaseHow much space the file with the games takes on disk.
Free space inside itThe space left by deleted games, which the file keeps for itself.

The verdict

  • The archive is in order — there is nothing worth compacting.
  • Compacting is worth it — deletions have left the archive fragmented.
  • Something is wrong in the archive — with one line for each problem. Compacting solves almost all of them, and the line says so. If the SQLite check has failed, though, the archive is damaged: it must be restored from a backup (see below).

Check again runs the check again.

Compacting

Compact archive renumbers the games from 1, in the same order, removes the names no game uses any more, rebuilds the search blocks and gives the free space back to the disk. It is a single operation: if something goes wrong before the end, the archive stays as it was.

Before starting it asks you to confirm, and recommends making a backup.

The backup really matters. Make one before you go ahead.

Games, collections, stars and analyses stay as they are; the selection in the list and the undos (⌘Z) made up to then are lost.

The button is on only when compacting is useful. It is also off while something is working on the games (an editor or a Game data window open, an import, a deletion, an automatic analysis, an export), and a line below says what: close it, let it finish, and try again.

It needs free space on the disk equal to twice the database.

Remove duplicates

From File › Remove duplicates, or with a right click on All games. It looks for games that are there more than once, with the same rules as the import (see duplicates), and before deleting it asks you to confirm, with the number.

Of each game a single copy stays: the one with annotations; if that is a tie, the analysed one, then the one with the star, then the one in more collections, then the oldest. The copy that stays takes the star and the collections of the others. Copies whose annotations differ from each other all stay, and the confirmation says how many there are. At the end a report says how many copies were removed.

It cannot be undone, and that is why the confirmation recommends making a backup first.

At startup

If the app was closed halfway through an import or a compaction, on the next launch it rebuilds the search blocks left behind. It shows as Rebuilding the position index, under Background work at the bottom of the sidebar; meanwhile the app can be used, and only the explorer waits.

Backup

The games are only on this Mac: the app does not send them to any service and does not sync them with iCloud. It does not make copies of its own: every change is written in full or not at all, so a crash or a power cut leaves the archive as it was, but from a mistake of yours, like deleting the wrong games, only a backup of yours protects you. That is why the questions before dangerous operations (deleting games, a collection with its games or all the games, removing duplicates, compacting, editing many games at once, emptying a repertoire) end with “Backing up the archive before proceeding is recommended.”

In the window, under the verdict and above the buttons, is the Backup section:

To back up the archive, click the Show in Finder button, quit the app (menu Terza Torre › Quit Terza Torre, ⌘Q) and copy the “data” folder to a safe place.

If you restore a backup, always make sure the app is closed.

Show in Finder opens a Finder window with the “data” folder selected. It must be copied whole, with the app closed: inside are the database, data.sqlite with its two companions data.sqlite-wal and data.sqlite-shm, and the bins folder with the search blocks, which must stay with the database they were made from.

To restore, with the app closed, you put the backup folder in place of “data”.

There is also Export… with a right click on All games: a PGN file with all the games, comments and variations included, which any chess program can read. Stars, collections, studies and repertoire are not in it: for those you need the backup of the folder.

If the archive does not open

If at startup the app cannot open the archive, it says so and works on a temporary archive: what you do then is not saved, and the “data” folder stays on the disk untouched. The message has Show in Finder: if the problem is still there after relaunching, quit the app and replace the folder with a backup of it.