# Updates and backups

KROMA checks for a new version of the server every six hours. When one is out,
the administration shows a notice, and **Server** > **Server updates** lists
what changed. How the update installs depends on how you installed the
server.

## Choose a channel

**Server updates** follows one of two channels:

- **Stable**: the tested releases.
- **Canary**: a new build for every change, often several a day. Newer, and
  less tested.

Until you choose, KROMA follows the channel of the build you installed. Change
it on the **Server updates** page.

## Update the server

### Synology package

The package installs updates by itself, when nobody is watching anything. To
choose the moment yourself, turn off automatic installation on the **Server
updates** page, then select the update there when it suits you.

### Docker

Download the new image and recreate the container, in the folder of your
compose file:

```bash
docker compose pull
docker compose up -d
```

Your data stays in the data folder or volume. To let the **Server updates**
page install updates for you, run KROMA's host updater beside Docker. It is a
small Python script that you install once on the computer; its setup is in
[server/updater](https://github.com/kromatv/kroma/blob/main/server/updater/README.md#docker-compose-linux-macos-windows-docker-hosts).

### Synology Container Manager, QNAP, Unraid and TrueNAS

Use your NAS's own way to update a container. Each guide gives it:
[Synology](https://kroma.tv/docs/synology.md#update-the-container) and
[Other NAS](https://kroma.tv/docs/other-nas.md).

## Update the apps

| App | How it updates |
| --- | --- |
| iPhone, iPad, Apple TV | TestFlight installs new versions |
| Android from Google Play | Google Play installs new versions |
| Android from an `.apk` file | install the new file over the old one |
| Samsung TV | `npx @kromatv/installer update`, or install the new `.tpk` (`.wgt` on a 2017 to 2020 TV), signed with the same certificate as before |
| LG TV | `npx @kromatv/installer update`, or install the new `.ipk` |
| macOS, Windows, Linux | the app updates itself |

## Back up your server

Your films and series are never in KROMA's data, so back them up as you
already do. KROMA's data holds your accounts, settings, watch history and
resume positions.

To make a backup:

1. Open **Server** > **Backup**.
2. Under **Export a backup**, select **Export**.
3. Turn on **Encrypt with a password**, and enter a password in
   **Encryption password**.
4. Select **Export**.

KROMA downloads a file named `kroma-backup-DATE.kroma`. Keep it somewhere safe.

> [!WARNING]
> Without a password, the backup holds password hashes and API keys in clear
> text. Always set one, and keep it: you need it to restore.

The backup does not include the catalogue of films and series: a scan rebuilds
it on the machine you restore to.

## Back up every night

KROMA can save a backup by itself each night and keep the last seven. It is
off until you turn it on.

1. Open **Server** > **Backup**.
2. Under **Scheduled backups**, turn on **Back up every night**.
3. Select the folder row, then choose a folder on another disk or on a share
   you back up. Until you choose one, KROMA uses the `backups` folder inside
   its data folder.
4. In **Backups kept**, set how many to keep.

KROMA saves `kroma-scheduled-DATE.kroma` at 3:00 and removes the oldest beyond
the number kept. It never removes another file from that folder. To change the
time, select **Change the time** and edit the **Scheduled backup** task.

> [!WARNING]
> A scheduled backup has no password, so it holds password hashes and API keys
> in clear text. Choose a folder only you can read.

If a backup fails, the **Scheduled backup** task shows why under **Server** >
**Tasks**, KROMA sends you a notification, and **Scheduled backups** shows the
reason on the Backup page.

## Restore or move to another machine

1. Install KROMA on the new machine and create a first account.
2. Open **Server** > **Backup**.
3. Under **Import a backup**, select **Import a file** and choose the backup.
4. Enter its password, then select **Restore**.

KROMA restores the accounts, settings and history, then scans your libraries.
If your media folders have another path on the new machine, change them under
**Sources** and scan again.

A restore keeps the libraries this server already has and adds the ones from
the backup. To make this server an exact copy of the old one instead, turn on
**Reset before restoring**. If that would remove libraries from this server,
KROMA lists them first, and removes them only when you select **Restore and
remove**.
