Skip to main content
Version: 1.0.4

Backup & Restore

A backup is a single portable .qbak archive bundling the two kinds of state that together make a working deployment. It is one file: nothing else has to travel with it.

What is in a backup​

KindContents
Database entitiesConnections, the namespace tree (nodes, tags, protocol bindings), alarm definitions, user-defined types, users, and the project registry — each dumped as a JSON section
File treesPer-project artifacts: views, scripts, named queries and assets
Not in a backupWhere it lives
Tag historyQuestDB — back it up with your database procedures
The audit journalThe external audit database — deliberately separate
Execution and system logsDiagnostic data, not configuration
Live runtime valuesReconstructed on start
.envBack it up separately; it holds ENCRYPTION_KEY

Encryption and secrets​

This is the part to get right.

BackupContains connection secretsAnyone opening it sees
Passphrase-encryptedYes, protected by the encryptionNothing without the passphrase — an opaque blob
UnencryptedNoConfiguration, with credentials blank

An unencrypted backup deliberately omits secrets so an unprotected archive cannot leak plant access. An encrypted backup is sealed whole — no usernames, no password hashes, no configuration, no secrets are readable without the passphrase.

Choose deliberately

An unencrypted backup restores with blank credentials — every connection must be re-entered. That is the right trade for an archive you cannot fully protect, and the wrong one for disaster recovery. For DR, use a passphrase and store it in your secrets manager.

Portability​

Backups are portable across machines because secrets are re-keyed in transit:

  1. On export, each connection is decrypted with the source machine's key.
  2. On restore, it is re-encrypted under the target machine's key.

The archive therefore never carries machine-key-encrypted blobs, which is exactly why copying the configuration database between machines does not work but a backup does.

Taking a backup​

Settings → Backup & Restore, which has a tab per scope:

TabCovers
Full instanceEverything — connections, the namespace, alarms, users, and every project
ProjectOne project's resources and assets
ViewsIndividual Designer views

Download backup (.qbak) writes the archive to your device. Give it a passphrase first if the backup is to carry connection secrets.

ScopePermission
Export or restore a full instance backupManage backups
Export or restore one projectManage projects
Import a project as a new projectCreate projects

Manage backups is super-admin-only by default: a backup can move an entire configuration off the machine.

Every export and restore is recorded in the audit journal.

When to take one​

  • Before every upgrade. Schema migrations are not reversible.
  • At each commissioning milestone, so there is a known-good point to return to.
  • Before any bulk operation — a large namespace import, a UDT sync across many instances, a bulk delete.
  • On a schedule, retained off the machine.

Restoring​

  1. Stop what you can safely stop — pipelines, ideally the whole gateway for a full restore.
  2. Choose the archive, supply its passphrase if it is encrypted, and choose the conflict policy.
  3. Verify connections: enable each one and check it reaches connected, and re-enter credentials if the backup was unencrypted.

A restore in this build turns back on what was switched off: a disabled connection resumes polling, a disabled tag resumes acquisition, and a suspended user is reactivated. Disable and suspend them again before you start pipelines. 4. Verify the namespace: check binding statistics for unbound tags. 5. Verify projects: open each and confirm views load. 6. Start pipelines.

The conflict policy​

This is the setting to get right. It decides what happens to what is already on the machine.

PolicyWhat it doesUse it for
OverwriteReplaces existing connections, namespace entries and project files whose identifiers match.A restore — putting a machine back the way it was.
MergeKeeps what is there and adds only what is new. Existing connections, folders and tags are matched by name or path, so nothing is duplicated.Bringing one machine's configuration onto another that already has its own.
AbortRefuses unless the instance is empty.A first restore onto a fresh install, when you want to be told rather than to find out.

Overwrite is the default, and it is the destructive one. Take a backup of the current state before restoring, even when you are confident — especially then.

The restore report​

A restore reports what it actually did: a count per section (connections, projects, namespace nodes, tags, protocol bindings, alarms, UDT definitions, members, instances and overrides), the number of files, and any warnings.

Read the unresolved connections list if there is one. Project resources reference a connection by name, so a project restored onto a machine that has no connection by that name lands with those references dangling — which shows as a broken binding rather than as a failed restore.

Migrating to a new machine​

1. Take a passphrase-encrypted backup on the source
2. Install QUBIQ on the target and complete first-run setup
3. Restore the backup
4. Point the historian at its QuestDB store (take ownership if the source is retired)
5. Configure the audit journal's storage connection
6. Check every connection reaches connected
7. Start pipelines, verify screens, then decommission the source

Step 4 matters: the historian records physical ownership inside the QuestDB store, so a restored configuration will refuse to write to a store the old machine still claims. Confirm the source is truly retired before taking ownership.

→ Store ownership

Project backups​

A project backup carries one project's resources and assets, not the instance's connections or namespace. Use it to promote an application between environments.

Settings → Backup & Restore → Project offers three actions:

ActionDoes
ExportWrites the chosen project as a .qbak.
RestorePuts a project archive back in place, under its original slug.
Import as newCreates a copy under a name you give it — the way to clone a project, or to bring a second copy of one onto a machine that already has it.

The prerequisite for all three is that the target already has connections and tags with the same names — project resources reference them by name, not by internal identifier. A restore says so in its report when they are missing.

For the plant model itself, use namespace export/import.

Disaster recovery​

A recoverable QUBIQ deployment needs five things, and losing any one leaves you rebuilding:

ItemStore where
Passphrase-encrypted configuration backupOff-machine backup storage
.env (or at least ENCRYPTION_KEY)Secrets manager, separate from the backup
The database recovery keyOn paper, off the machine
QuestDB backupYour database backup procedures
Audit database backupIts own procedures, under separate administration

Test the restore. A backup that has never been restored is a hypothesis, not a plan. Restore into a scratch machine at least once per commissioning cycle.

Next​

→ Logs & diagnostics