# The journal on the server

For every synced folder the server keeps a **journal**: one entry for each file that was changed, deleted or renamed, and for each conflict. The computers that sync the folder ask the server every few seconds what is new since the last entry they have, and repeat it locally. The journal is how a change made on one computer reaches the others.

Earlier versions of files (revisions) are not part of the journal. They are files in the folder named as **Revisions Storage Path** ([Server setup](Server-Setup.md)).

## CrushMFT 27: plain files

CrushMFT 27 keeps the journal in text files. There is no database and nothing to set up on a single server.

```
activity/sync/                           in the server's folder (see "Where" below)
  PROJECTS/                              one folder per sync, named after it
    20261120.n0-87629b23.jnl             one file per day and per server
    20261121.n0-87629b23.jnl
  .writers/                              which servers write here
```

A day file has one line per change:

```
# CrushFTP sync journal 1: id, time (UTC), event, client id, prior md5, path
1795179440268	2026-11-20T12:57:20.268Z	CHANGE	ab12		/Projects/Report.txt
1795179440317	2026-11-20T12:57:20.317Z	CHANGE	cd34	9f089b639127e2f5a79c4eda189678d6	/Projects/Report.txt
1795179440352	2026-11-20T12:57:20.352Z	RENAME	ab12		/Projects/Report.txt;/Projects/Report-2026.txt
1795179440407	2026-11-20T12:57:20.407Z	DELETE	ab12		/Projects/Old.txt
```

| Column | What it is |
|---|---|
| id | The entry's number: the time in milliseconds. It only ever grows. Each computer remembers the last id it has. |
| time | The same moment, readable. |
| event | `CHANGE` (a new or changed file or folder), `DELETE`, `RENAME` (old path, `;`, new path) or `CONFLICT`. |
| client id | Which computer made the change. A computer is not told its own changes. Empty for a change that did not come from CrushSync (FTP, SFTP, the WebInterface, a job). |
| prior md5 | The MD5 of the version the change replaced. CrushSync uses it to tell an older version from a real [conflict](How-Syncing-Works.md#when-two-people-change-the-same-file). |
| path | The item, from the user's root on. |

You can read the files with any text tool, for example to see who changed a file and when:

```
grep "Report.txt" activity/sync/PROJECTS/*.jnl
```

Do not edit them. A line that is not a complete entry is skipped.

### Where

The journal is the folder `sync` inside the server's activity folder: `activity/` in the server's own folder, or the folder set under **Preferences › Reporting**, **Our own files**, **Folder**. It works the same whether reporting is switched on or not.

The first time a sync is used after a start, the server's log says where the journal is:

```
SYNC journal: /var/opt/CrushMFT27/activity/sync, this server writes as n0-87629b23
```

### How much is kept

**Preferences › Sync Config**, **Keep x days of Syncs history** (30 by default). Once an hour the server deletes the day files that are older. About 130 bytes are written per change, so a million changes are about 130 MB.

### Backup

Copy the folder with the rest of the server. If the journal is lost, the syncs go on from the next change; what was in it is gone, with the effect described under [After a longer absence](How-Syncing-Works.md#when-you-are-offline).

## Several servers

Servers that serve the same users (a cluster behind a load balancer, or replicated servers) must share the journal. If each kept its own, a computer would only hear of the changes that went through the server it reaches.

They share it by sharing one folder:

1. Give every server the same activity folder, one that all of them can reach: **Preferences › Reporting**, **Our own files**, **Folder**.
2. Give every server its own **Node number** on the same screen.

That is all. Each server writes its own day file (the `n0-…`, `n1-…` part of the file name) and reads the files of the others.

- A change made through one server reaches the computers connected to another server about 5 seconds later than on a single server. The servers wait that long so that every one of them has seen an entry before any computer is told of it, whatever the difference between the servers' clocks.
- If reporting uses a database of its own, or the journal should be somewhere else, set `sync_journal_path` in `prefs.XML` to a shared folder on every server. There is no screen for this setting.
- Two servers that write under the very same name are told so in the log (`another server writes … under the same name`). Give each its own node number.

## CrushFTP 11: a database

CrushFTP 11 keeps the journal in a database: an embedded Derby database by default, or MySQL when several servers share it. **Preferences › Syncs** has the days to keep, the database's driver, address and login, the script that creates the table, and a query window. See [Syncs](../CrushFTP11/Syncs.md) in the CrushFTP 11 documentation.

## Moving from CrushFTP 11 to CrushMFT 27

Nothing has to be converted and no database is needed afterwards. CrushMFT 27 starts with an empty journal, and the computers carry on from where they were: they are told every change made from then on.

What is not carried over is what happened on CrushFTP 11 while a computer was switched off. Such a computer compares its folder with the server when it starts and gets every new and changed file that way. It is not told what others deleted or renamed in that time, so those files can come back from it. Let the computers finish syncing before the move, where that is possible.
