Back up and restore

Make a complete backup with one command, and restore it onto a new server.

OpticWatch keeps everything in its database: your cameras, sites, incidents, history, settings, the installation's identity and its license. The camera, email and webhook passwords in it are encrypted with a key that belongs to this installation. A backup holds both the database and that key, so it is everything needed to bring the installation back.

Make a backup

In the OpticWatch folder, run:

Terminal or PowerShell
docker compose run --rm backup

This writes one file into the backups folder inside the OpticWatch folder, named like opticwatch-backup-pro-20261002-180000.tar. OpticWatch keeps running while it does.

  • Copy it somewhere safe, away from this computer, so a failed disk or a lost server does not take your backups with it.
  • Keep several, and make a new one before every update and after significant changes.

From 1.2.0, the update manager also backs up before every update. It keeps every backup in one opticwatch-backups folder beside your release folders, and the backups folder of each release it installs points there, so removing an old release folder never removes a backup.

Restore a backup

Restore onto a new or rebuilt computer, using the same OpticWatch release you backed up from or a newer one, before OpticWatch has been started there.

  1. Install Docker and extract OpticWatch, but do not start it

    Follow Install Docker and steps 1 and 2 of Install OpticWatch. Stop before running docker compose up -d.

  2. Put the backup file in the backups folder

    Copy your backup file into the backups folder inside the new OpticWatch folder.

  3. Restore it

    In the OpticWatch folder, run, with your file's name:

    Terminal or PowerShell
    docker compose run --rm restore opticwatch-backup-pro-20261002-180000.tar
  4. Start OpticWatch

    Terminal or PowerShell
    docker compose up -d

    Sign in with your existing administrator account. Everything is as it was when the backup was made.

The restore puts back the database and its encryption key together, so every stored password works as before. The restored installation keeps its identity, so an activated license keeps working without activating again. Do not run the original and the restored copy at the same time with the same license; moving a license is what deactivation is for.

If you started OpticWatch before restoring

The restore refuses to write into an installation that already has data, rather than mixing two installations. If you ran docker compose up -d on the new computer first, that brand-new, empty installation has to be removed before you restore.

Search every OpticWatch guide, down to the section.