Source: https://help.spamfoo.com/guides/updates
Last updated: 2026-10-27

***

# Update and Back Up

SpamFoo Client updates its models and its own program on its own. In Docker, it updates its models, and you update the program by pulling a new image. See [Update Docker](https://help.spamfoo.com/guides/updates#update-docker). This page explains how updates work, how to back up SpamFoo Client, and how to move it to a new server.

## Model Updates

SpamFoo Client checks for new models about every 6 hours. You can change how often with `SPAMFOO_UPDATE_INTERVAL_HOURS` (see [Configure SpamFoo Client](https://help.spamfoo.com/guides/configure#env-updates)). When a new model is available, SpamFoo Client does the following:

- Downloads the model.
- Checks the file against its SHA-256 hash and SpamFoo's digital signature. A file that fails either check is not used.
- Pauses scanning briefly to load the new model, while new messages wait in the queue. If that doesn't work, it finishes the messages in progress and restarts with the new model.
- Keeps the current and the previous version of each model, and deletes older ones.

The **Versions** card on **System > Status** shows the version of the client and of each model.

To check for new models right away:

1. Go to **System > Status**.
2. In the **Maintenance** card, click **Run** next to **Update Models**.
3. Confirm.

The result appears under the action when it finishes.

## Program Updates

SpamFoo Client checks for a new version of itself at the same time it checks for models. When a new version is available, SpamFoo Client does the following:

- Downloads the new version and checks it against its SHA-256 hash and SpamFoo's digital signature.
- Waits for the messages it's scanning to finish, then stops.
- Runs an update script that replaces the program files. Your data, settings, and models are not touched.
- Keeps copies of the two previous versions in the `updates/backup` folder of the install folder.
- If the same version fails to install three times, stops trying that version until a newer one is released.

SpamFoo Client does not start itself again after an update. What happens next depends on how you run it:

| How You Run It | After an Update |
| --- | --- |
| SmarterMail | SmarterMail starts SpamFoo Client again. |
| Linux archive with a systemd service | systemd starts SpamFoo Client again, if the service file has `Restart=always` and `KillMode=process` as shown in [Install From the Archive](https://help.spamfoo.com/guides/install#tarball). |
| Windows, or started by hand | Start SpamFoo Client again yourself. |
| Docker | Pull a new image instead. See [Update Docker](https://help.spamfoo.com/guides/updates#update-docker). |

The **Versions** card on **System > Status** shows which version of the client is running.

### Update the Program Now

In Docker, **Update Client** only shows whether a newer version is available. To update, see [Update Docker](https://help.spamfoo.com/guides/updates#update-docker). With the Linux package, or when program updates are turned off, **Update Client** is grayed out and explains how to update instead.

1. Go to **System > Status**.
2. In the **Maintenance** card, click **Run** next to **Update Client**.
3. Confirm.

### Turn Off Automatic Program Updates

Set the environment variable `SPAMFOO_DISABLE_BINARY_UPDATE=true` and restart SpamFoo Client. With the Linux package, add the line to `/etc/spamfoo/spamfoo.conf`. Model updates keep running.

For an archive install:

1. Stop SpamFoo Client.
2. Download the new archive from the [Downloads](https://www.spamfoo.com/account/downloads) page in your SpamFoo account, and extract it over the install folder.
3. Start SpamFoo Client.

> **Note** If you leave SpamFoo Client without updates for a long time, it may stop getting new models, and some features may stop working.

### Update Docker

In Docker, SpamFoo Client never replaces its own program. To update it, start a new container from a newer image. Models, settings, history, and the proxy secret carry over because they're stored in the `/data` volume.

#### If You Use docker run

1. Pull the new image. Use `latest`, or the version tag you want:

   ```
   docker pull spamfoo/spamfoo-client:latest
   ```
2. Stop and remove the old container. Use your container's name in place of `spamfoo-client`:

   ```
   docker stop spamfoo-client
   docker rm spamfoo-client
   ```
3. Run the same `docker run` command you used to install it, with the same `/data` volume and environment variables. If you use a version tag, change it to the new one. See [Install SpamFoo Client](https://help.spamfoo.com/guides/install).

#### If You Use Docker Compose

1. If your compose file uses a version tag, such as `image: spamfoo/spamfoo-client:1.2.3`, change it to the new version. Skip this step if it uses `latest`.
2. In the folder with your compose file, pull the new image and recreate the container:

   ```
   docker compose pull spamfoo-client
   docker compose up -d spamfoo-client
   ```

Use the service name from your compose file in place of `spamfoo-client`. Docker Compose keeps the same volume and environment variables, so nothing else changes.

Besides `latest` and exact versions such as `1.2.3`, each release is also tagged with its major and minor version, such as `1` and `1.2`. Those tags move to the newest release in that line when you pull. See [Pick an Image Tag](https://help.spamfoo.com/guides/install#docker-tags).

In standalone mode, the **Update Client** row in the **Maintenance** card on **System > Status** tells you when a newer version is available.

> **Note** Older images kept models in `/data/models`. Newer images keep them in `/data/trained-models`, so the first start after the update downloads the models again. You can delete `/data/models` afterward.

Old images stay on disk after an update. To remove them, run `docker image prune`.

## Database Maintenance

SpamFoo Client looks after its own database:

- Old scan records and totals are deleted once a day, and each time SpamFoo Client starts, based on the [retention settings](https://help.spamfoo.com/api/settings#scan-history).
- Nightly backups run on their own when turned on. See [Back Up SpamFoo Client](https://help.spamfoo.com/guides/updates#backup).

The **Storage** card on **System > Status** shows the database size, how many messages are stored, the date of the oldest record, and where each folder is. To use less space, see [Disk Space](https://help.spamfoo.com/guides/system-requirements#disk-space).

## Back Up SpamFoo Client

### Nightly Backups

The **Database Backups** card on **System > Settings** controls the built-in backups. By default they're on, run at 2 AM server time, and keep 7 nights.

Each night, SpamFoo Client creates a folder named for the date, such as `backups/2026-10-05`, in the data directory. It holds:

- `admin.db`: settings, scan history, and totals
- `user_settings.db`: personalization settings
- `correction_archive.db`: corrections reported from this server
- `domain_age.db`: saved domain ages
- `personalization/`: each user's learned preferences

A backup that doesn't finish is never saved as a finished one. A failed backup is written to the log and does not affect mail.

The backups are on the same disk as the live data. Copy the newest backup folder to another machine or storage location as part of your normal server backups.

On SmarterMail, some personalization files are stored in each user's mail folder. SmarterMail's own backups cover those files.

### What to Back Up

- **The newest folder in `backups/`**.
- **The `etc/` folder.** Nightly backups don't include it. It holds the license key, the proxy secret, the release channel, and the `keys` folder that protects stored passwords. Without `etc/keys`, stored passwords can't be read after a restore.
- **The settings file**, if you use one: `/etc/spamfoo/spamfoo.conf` with the Linux package, or `spamfoo.conf` in the data directory.

You don't need to back up `trained-models/`, `runtime/`, or `logs/`. Models and NVIDIA libraries are downloaded again when needed.

> **Warning** Do not copy `admin.db` or other database files while SpamFoo Client is running. A copy made during a write can be damaged. Use the files in the newest `backups/` folder, or stop SpamFoo Client first.

> **Important** The `etc/` folder holds secrets. Anyone with the license key or proxy secret can act as your server. Limit who can read your backups, and encrypt them where they're stored.

## Restore or Move to a New Server

1. Install SpamFoo Client on the new server. See [Install SpamFoo Client](https://help.spamfoo.com/guides/install).
2. Stop SpamFoo Client on the new server.
3. Copy the `etc/` folder from the old server into the new data directory, and copy the settings file if you use one.
4. Copy the files from the newest backup folder into the new data directory, as shown in the table below.
5. Start SpamFoo Client.

| From the Backup Folder | To the Data Directory |
| --- | --- |
| `admin.db` | `admin.db` |
| `domain_age.db` | `domain_age.db` |
| `user_settings.db` | `personalization/user_settings.db` |
| `correction_archive.db` | `correction_archive/correction_archive.db` |
| `personalization/` | `personalization/` |

On Linux, give the copied files to the account that runs SpamFoo Client before you start it. With the Linux package, that's `sudo chown -R spamfoo:spamfoo /var/lib/spamfoo`.

SpamFoo Client downloads the latest models when it starts.

Personalization data is stored only on your server. Without a backup, it can't be recovered. Users rebuild it over time as they correct their mail.

## Log Rotation

SpamFoo Client starts new log files and deletes old ones on its own. See [Find the Log Files](https://help.spamfoo.com/guides/monitoring#log-files). You don't need a separate log rotation tool such as `logrotate`, and one may conflict with SpamFoo Client's own rotation.
