Administration and integrations

Updates, backup and restore

Take a backup, apply the update, confirm the application answers — and keep the backup, because restoring it is the only rollback there is. The update does not back anything up for you, and nothing updates itself.

ABOUT 8 MINUTESTUTORIALFOR IT

Goal

Move an installation to a newer build with a backup you can restore, and know how to go back if it does not come up.

Before you begin

  • Administrator rights on the server: an elevated prompt on Windows, root or Docker access on Linux
  • Which install you have: the Windows installer, or Linux with Docker Compose
  • Somewhere off the machine to keep the backup
  • A window in which the application can be stopped
The update takes no backup, and nothing rolls it back

No install path backs anything up before an update, and there is no automated rollback. The newer build migrates the database the first time it starts, and nothing reverses a migration except restoring the backup you took.

  1. Take a backupThe database, the documents and the search index, kept off the machine.
  2. Apply the updateA newer installer, or newer images.
  3. The database migratesThe first time the newer build starts. Nothing reverses it.
  4. Confirm it came back/health/ready answers.
  5. If it did not, restoreThe backup from the first step, with the version you came from.
The last step is the only rollback, which is why the first step comes first.

Take a backup first

The backup each install path provides
Install pathCommandWhat it capturesWhere it writes
Windows installer.\Logley.Setup.exe backup --out <file>, from the setup folder of the install directory, elevatedThe database only, as a compressed pg_dump in custom format — encrypted when you give it a key fileThe --out file; without it, logley-<date>-<time>.dump in %ProgramData%\Logley\backups. Either way, readable by SYSTEM and administrators only
Linux with Docker ComposeNo scriptNothing — see below—

Windows. The engine’s backup is the database alone — not the document files, the search index or the licence. Complete it with a copy of three folders from the data directory (%ProgramData%\Logley\data by default): documents, qdrant and licensing. Stop the API and Qdrant first so the copy is consistent, and start everything again with restart, which waits until the application answers:

.\Logley.Setup.exe backup --out D:\Backups\logley.dump
Stop-Service LogleyApi, LogleyQdrant -Force
.\Logley.Setup.exe restart

Copy the folders between the second command and the third, from the same elevated prompt — with robocopy, for example. The data directory is readable by SYSTEM and administrators only, and copying it in File Explorer instead offers to add your account to its permissions, which leaves it open to that account from then on.

The default backup folder, %ProgramData%\Logley\backups, is inside neither the install directory nor the data directory, so an uninstall leaves it in place, even one that erases the data; backups an earlier version wrote into the install directory are moved there before that directory is removed. Keep copies off the server all the same. A backup is written under a temporary name and takes its real one only when it is complete, so one that fails leaves nothing that looks like a backup, and an earlier file of the same name stays as it was.

Encrypting a Windows backup. A backup is readable by anyone who holds the file, wherever you copy it. To encrypt one, create a key once and give it to every backup and restore. The dump is encrypted as the database is read, so no unencrypted copy is written anywhere; without --out, it goes to the backup folder as logley-<date>-<time>.dump.enc:

.\Logley.Setup.exe backup-key --out E:\logley-backup.key
.\Logley.Setup.exe backup --key-file E:\logley-backup.key
An encrypted backup cannot be restored without its key

Keep a copy of the key file somewhere other than the server and other than the backups. A key lost with the server takes every backup encrypted with it along, and backup-key never writes over an existing key file for the same reason.

Linux with Docker Compose. There is no backup script for the containers: the backup.sh and restore.sh among the deployment files do not work against them. From the directory that holds docker-compose.yml (/opt/logley with the Linux installer), dump the database from its container:

docker compose exec -T postgres pg_dump -U logley -Fc logley > postgres.dump

Then back up the documents, qdrant and licensing volumes with the stack stopped, together with .env and deploy/nginx/certs.

Apply the update

Windows. Run the newer Logley-Setup-<version>.exe with the same install and data directories. It removes and re-registers the services, copies the new program files over the old ones and removes those the new version no longer ships, keeps the data directory, migrates the database (a migration that fails stops the install) and waits for the application to answer. The First Sign-In password on its last screen applies only to a server with no accounts; after an update, keep using your existing sign-in. An unattended update is the same install --config … --silent command as a first install.

The wizard writes a new encryption key on every run

Its configuration file gets a newly generated key for the credentials Logley stores encrypted. After an update through the wizard, the mailbox, SMTP, ERP, CRM and e-invoicing credentials saved before it no longer decrypt: enter them again. An unattended update keeps the key if its configuration file supplies the current value as encKey — it is EMAIL_ENCRYPTION_KEY in api\appsettings.Production.json in the install directory.

Linux with Docker Compose. From the directory that holds docker-compose.yml, pull the new images and recreate the containers. The API migrates the database as its new container starts:

docker compose pull
docker compose up -d
bash deploy/scripts/verify-install.sh

That is what install.sh does when .env already exists, along with downloading the models it names. Running a newer Linux installer over the same install directory works too: it keeps the database, the accounts and the encryption key. VERSION in .env chooses the tag of the three Logley images: the Linux installer sets it to its own version, so a pull fetches nothing newer until you change it or run a newer installer, and an install from the deployment files has latest. Qdrant and Ollama are pinned in docker-compose.yml to the versions the Windows installer bundles, and change only with a newer docker-compose.yml. On a server with no internet access, load the new images first, as in installing without internet access.

Database migrations

The API applies any pending migrations every time it starts, on every install path, so there is no separate migrate command to remember. The Windows installer also runs them as a step of its own before it starts the service, and fails the install if they fail. With Docker Compose, a migration that fails stops the API from starting, which the health check then shows.

Confirm it came back

Both health endpoints answer without signing in: /health/live as soon as the process is up, /health/ready once PostgreSQL, Qdrant, Ollama, the document storage, the job scheduler and the classifier all answer. A further check reports Degraded, with the endpoint still answering 200, when stored credentials (a mailbox password, for instance) cannot be decrypted with the current EMAIL_ENCRYPTION_KEY.

  • Windows — the installer waits for the application itself; if it does not answer in time you get a warning, not a failure. .\Logley.Setup.exe doctor then checks the services, the database, the certificate and the free disk.
  • Docker Compose — verify-install.sh waits up to 30 seconds for /health/ready. If it does not answer, read the API’s log with docker compose logs --tail=50 api.

The deployment guide describes each of these checks in full.

Restore — the only rollback

How each install path restores a backup, and what it replaces
Install pathRestoreWhat it replaces
Windows installerStop LogleyApi, run .\Logley.Setup.exe restore --in <file> (adding --key-file <file> for an encrypted backup), copy documents, qdrant and licensing back with Qdrant stopped, then .\Logley.Setup.exe restart.The contents of the database. It stops at the first error rather than finish with objects missing, and it does not stop the API for you. An encrypted backup is checked in full before the database is touched: with the wrong key, or altered or incomplete in any part, nothing is restored. Given a key file, a backup that is not encrypted is refused.
Linux with Docker ComposeThe commands belowWhat you restore.
docker compose stop
# put the documents and qdrant volumes back
docker compose up -d postgres
docker compose exec -T postgres pg_restore -U logley -d logley --clean --if-exists --no-owner < postgres.dump
docker compose up -d

To go back to the version you updated from, stop the application, restore the backup you took before the update, and start that version again — its installer on Windows, its tag in VERSION with Docker Compose. The newer build migrated the database the first time it ran, so the older version needs the database from before.

Scheduling backups

Logley has no backup scheduler, and nothing deletes old backups. Schedule the command yourself — Task Scheduler on Windows, cron on Linux. The Windows backup command reads the database password from the installation’s own settings, so it runs unattended as an administrator or as SYSTEM; give each run its own --out file, or leave it out to get a time-stamped file in %ProgramData%\Logley\backups. A scheduled backup encrypts the same way, with --key-file; the key file backup-key writes is readable by SYSTEM and administrators.

A backup you have never restored is an assumption. Restore one onto a spare machine before you rely on it.

NEXT GUIDEPrepare a first evaluation
Continue

Continue exploring

Was this guide useful?

If something was missing or unclear, the contact page says where to write.

Contact