Skip to content

Back up and restore the server

This page is for on-premises servers. In the cloud, IZT looks after the server.

WhatWhereHow often
The databaseYour database serverRegularly, with your usual database backup tools
The data folderThe volume mounted at /dataAfter first setup, and whenever the database key changes
The recovery kitThe two files you downloaded during setupOnce, kept offline

Every secret in the database is encrypted with the database key, which is not stored in the database. A database backup on its own cannot be restored: you also need the key, either from the data folder (/data/secrets) or from the database key backup in your recovery kit.

An instance owner can rotate the database key under Instance › Identity, in the Change the identity key card, with Rotate database key. Blink seals every secret again with a new key, and the old database key backup no longer opens anything, so:

  1. Enter a passphrase for the new backup (at least 12 characters), confirm it, and select Rotate and download.
  2. Prove the downloaded backup opens with that passphrase when the console asks.
  3. Replace the old database key backup in your recovery kit.
  4. Back up the data folder again.

If you have lost the database key backup file, rotating the database key is also how you get a new one.

Use this when the original server is gone and you are bringing Blink back from backups.

  1. Restore your database backup on the new database server.

  2. Copy the database key backup (blink-kek-<instance>-<date>.json) to the new host, somewhere the container can read it. The container runs as an unprivileged user (uid 65532), so the file must be readable by that user.

  3. Restore the database key into a new, empty data volume. The server asks for the recovery kit passphrase:

    Terminal window
    docker run --rm -i -v blink-data:/data -v /path/to/kit:/kit:ro \
    <blink-server-image> -restore-kek /kit/blink-kek-<instance>-<date>.json

    Instead of typing it, you can pass the passphrase in the BLINK_KEK_PASSPHRASE environment variable. The command writes the key into /data/secrets, prints which instance it restored, and exits.

  4. Start the server as usual (see Install Blink on your own server), pointing it at the restored database and the same data volume.

  5. Point your DNS name at the new server.

The server refuses to start if the data volume belongs to a different installation than the database, so you cannot mix them up by accident.

Because the server’s identity comes back with the database, your Access agents reconnect on their own once the DNS name points at the new server. You do not need to reinstall them.

If the server’s identity was lost or stolen

Section titled “If the server’s identity was lost or stolen”

If you think someone else has a copy of your server’s identity key (for example, a stolen backup or disk image), the recovery key in your recovery kit lets you replace it without reinstalling your agents. An instance owner does this under Instance › Identity with Recover with the recovery file. The change goes to IZT and then to every Access agent, and you get a new recovery file. If the server itself may be compromised, rebuild it from clean backups first, then recover. If you are unsure, contact IZT before you start.