Backup and takeover
How the host's data is backed up, what the recovery key does, and how to take over when the host fails or needs to move.
Backups
A backup is an encrypted copy of its database that the host regularly saves to the store.
Records such as projects, tasks, devices and tokens exist only in the host's database. The store holds only files. With backups, if the host fails, another device can take over.
- When it backs up: when the database has changed, every 10 minutes by default. After a device joins, access changes, tokens change, the store changes or a task is submitted, it backs up within a minute. No changes, no backup.
- How many are kept: one per hour for the last day, one per day for the last month, and the latest one is always kept.
- The recovery key comes first: a backup can be opened only with the recovery key. Without a recovery key, no backups are made.
Under Workspace details → Store → Backups, see the Latest backup, change the Backup interval, or click Back up now.
When the store is This device, the backups are on the host computer too, so if that computer fails, nobody can take over. To be able to take over, the store must be a shared folder or S3.
Recovery key
The recovery key is the key that opens the backups: 8 groups of 4 letters or digits.
It is shown once after you create a workspace, and the dialog closes only after you click I’ve saved it. The host doesn't keep it. The only copy is the one you wrote down.
- You can Regenerate it under Workspace details → Store → Backups. The new key is also shown only once, and the old one stops working right away.
- Old backups can still be opened with the new recovery key.
Takeover
Takeover restores the workspace from the backup in the store on another device, making that device the new host.
Find a device that can reach the store and isn't a host itself:
- Open Create or take over a workspace… and choose Take over from backup.
- Enter where the store is (shared folder or S3) and the recovery key.
- Click Take over. Once you restart danio as prompted, this device is the new host.
You lose only the changes made after the last backup, which is usually just the last minute. Tasks submitted after that need to be submitted again; the files are already in the store, so it goes quickly. Devices that joined after that need to join again.
When the old host is fixed and started again, it notices within a minute that it has been taken over and stops handing out work, with a notice at the top of the interface. After you restart danio, it connects back to the new host as a device, with "Admin" access.
Changing hosts
Changing hosts means moving the host to another device without waiting for the old one to fail.
- On the old host, click Back up now under Workspace details → Store → Backups.
- On the new machine, follow the takeover steps above.
This way nothing is lost, and the old host steps down by itself.
The other devices need to connect to the new host:
- Devices that connect by domain: point the domain at the new host, and the devices don't need any change.
- Devices that connect by IP: when a device can't reach the host, the interface shows Change host address, where you enter the new address. You can also run
danio workspace set-host <address>on that device. Before saving, it checks that the address belongs to the same workspace.