Backups & Upgrades

Back up the server's database, configuration, and certificate state together, then validate recovery before you need it.

What to back up

WhatWhyWhere (Linux guided install)
DatabaseAccounts, rooms, messages, roles, and file attachments/var/lib/speakeasy-self-host/speakeasy.sqlite
Config / env fileIncludes your server's auth secret; preserve it with the database/opt/speakeasy-self-host/config/server.env
TLS certificatesPreserves certificate state for recovery/opt/speakeasy-self-host/control/certs

On Windows, the packaged installer keeps all server state under one data root, %ProgramData%\SpeakeasySelfHost: the database at data\database.sqlite, the config / env file at config\server.env, and TLS certificates under certs\. The SQLITE_PATH line in server.env names the database file your server uses. Attachments are stored inside the database, so there is no separate uploads folder to remember.

These are default packaged/guided paths; use the effective install/data/control/config roots recorded for your installation.

Taking a backup (SQLite)

Linux

  1. Stop the server so the database file is quiescent:
    sudo systemctl stop speakeasy-self-host
  2. While the service is stopped, back up all three effective Linux roots: data (default /var/lib/speakeasy-self-host), config (default /opt/speakeasy-self-host/config), and control (default /opt/speakeasy-self-host/control). Preserve file owners and permissions, and keep the database and its SQLite journal files together.
  3. Start it again:
    sudo systemctl start speakeasy-self-host

Windows

  1. In PowerShell running as Administrator, stop the server so the database file is quiescent:
    Stop-Service SpeakeasySelfHost
  2. While the service is stopped, copy the whole effective data root (default %ProgramData%\SpeakeasySelfHost). Its folders grant access only to SYSTEM and Administrators; keep those permissions on the copy, and keep the database and its SQLite journal files together.
  3. Start it again:
    Start-Service SpeakeasySelfHost

Do not open the database with your system's sqlite3 tool. The server bundles a newer SQLite than many operating systems ship, and an older sqlite3 command-line tool can report the schema as malformed even though the database is healthy. Do not use it to inspect, check, or repair the database; back up and restore by copying the stopped server's files as described above.

For advanced installs using PostgreSQL, use pg_dump for the database and back up configuration and control state separately.

Restoring

  1. Install the same server release on the recovery machine. Same-release recovery is the baseline; cross-version restore requires the release's supported procedure.
  2. Stop the service. Restore every root you backed up (Linux: the data, config, and control roots; Windows: the data root), preserving owners, permissions, and the configured paths.
  3. If the machine's IP or domain changed, update DNS and the domain settings in server.env before restarting.
  4. Start the service and verify accounts, rooms, and attachments from the backup.

If the database is missing or different

The server records which database it serves in config/instance-identity.json under the self-host root, outside the data directory. If that database later goes missing or is replaced, the server refuses to start rather than silently creating an empty instance, and logs one of SERVER_DATABASE_MISSING, SERVER_DATABASE_CONFIRMATION_MISMATCH, SERVER_DATABASE_DIALECT_CHANGED or SERVER_INSTANCE_IDENTITY_MISMATCH. Restore the original database and start again. To deliberately start on a new database, set SPEAKEASY_ACCEPT_NEW_DATABASE=<old id> using the profile id in the message; the previous marker is kept beside it as instance-identity.<old id>.json.

Upgrading the server

  1. Take a backup first (above).
  2. Follow the release's supported upgrade procedure. For a release that uses the guided installer's upgrade mode:
    sudo ./install.sh --upgrade
  3. The Linux tarball upgrade validates the new release before stopping the service. It preserves data and configuration, retains the previous release in .release-previous, and checks health after starting. If startup fails and the database schema has not changed, it restores the previous release and retains the failed release in .release-failed. If the schema has changed, it stops and reports the snapshot needed for recovery. Database migrations apply automatically on startup.
  4. If an upgrade is interrupted, running the command again resumes or rolls it back. The Docker installer keeps release images tagged speakeasy-self-host:release-<id> for recovery.

On Windows, follow the release's supported self-host installer upgrade procedure. The packaged data root defaults to %ProgramData%\SpeakeasySelfHost; back up your effective roots before upgrading.

Upgrading clients

Desktop clients notify users of updates (Windows and AppImage can self-update after confirmation; Linux .deb/.rpm are manual). Use the client/server versions and upgrade order declared for the release.

Test your backup once. A backup you have never restored is a hope, not a backup. After your first backup, restore it onto a spare machine or a temporary directory and confirm the server starts.