---
title: "Upgrade an existing installation"
description: "Upgrade slopscale one minor version at a time: read the release notes, stop the server, back up the database and configuration, update, restart."
sidebar:
  label: "Upgrade"
---

:::tip[Required update path]

It's required to update from one stable version to the next (e.g. 0.34.0 → 0.35.0 → 0.36.0) without skipping minor
versions in between. You should always pick the latest available patch release.
:::

Update an existing Slopscale installation to a new version:

- Read the announcement on the [GitHub releases](https://github.com/aislopware/slopscale/releases) page for the new
  version. It lists the changes of the release along with possible breaking changes and version-specific upgrade
  instructions.
- Stop Slopscale
- **[Create a backup of your installation](#backup)**
- Update Slopscale to the new version, preferably by following the same installation method.
  With the [apt repository](/slopscale/setup/install/official), that is `sudo apt update && sudo apt install slopscale`. The
  repository offers only the latest release, so when you are more than one minor version behind, install the versions
  in between from their `.deb` on the releases page first. `sudo apt-mark hold slopscale` keeps `apt upgrade` from
  updating the server along with everything else.
- Compare and update the [configuration](/slopscale/ref/configuration) file.
- Start Slopscale

## Backup

Slopscale applies database migrations during upgrades and we highly recommend to create a backup of your database before
upgrading. `slopscale db backup` copies the database through SQLite itself and reads the copy back before it keeps it.
The configuration directory is copied separately, because the keys and the policy file are not in the database. See
[Backup and restore](/slopscale/setup/backup) for restoring one, for taking one on a schedule and for PostgreSQL.

**Standard installation**

An installation that follows our [official releases](/slopscale/setup/install/official) setup guide uses the following paths:

- [Configuration file](/slopscale/ref/configuration): `/etc/slopscale/config.yaml`
- Data directory: `/var/lib/slopscale`
- SQLite as database: `/var/lib/slopscale/db.sqlite`

```console
sudo -u slopscale slopscale db backup
sudo cp -aR /etc/slopscale /etc/slopscale.backup-$(date +%Y%m%d%H%M%S)
```

The copy lands next to the database as `/var/lib/slopscale/db.sqlite.backup-<timestamp>`.

**Container**

An installation that follows our [container](/slopscale/setup/install/container) setup guide uses a single source volume directory
that contains the configuration file, data directory and the SQLite database.

```console
docker exec slopscale slopscale db backup
cp -aR /path/to/slopscale/config /path/to/slopscale/config.backup-$(date +%Y%m%d%H%M%S)
```

**PostgreSQL**

`slopscale db backup` is SQLite only. Use `pg_dump` and follow PostgreSQL's
[Backup and Restore](https://www.postgresql.org/docs/current/backup.html) documentation
to create a backup of your PostgreSQL database.

```console
pg_dump --format=custom --file=slopscale-$(date +%Y%m%d).dump --username=slopscale slopscale
```
