Files
wekan/docs/Features/Admin-Panel/Attachments
Lauri Ojansivu 6b9bc496b1 Add continuous backup to the Admin Panel: stream every change, restore to a moment.
Admin Panel / Attachments / Continuous backup, beside Backup, streams the
database, filesystem attachments, avatars and logs to a target directory
within seconds, so less work is lost between scheduled archives and a
restore can return to a chosen moment. Design: docs/Backup/Continuous-Backup.md.

The built-in engines use only copyfree code - WeKan's own (MIT), Node.js
and its node:sqlite (SQLite, public domain) - and start no other program:

- oplog: tails local.oplog.rs like Meteor's oplog driver, on a MongoDB
  replica set or FerretDB with its oplog; a base archive (the existing
  wekan-instance-backup format), then whole documents and deletions,
  continued from the saved position after a restart, a new generation
  when the oplog has lost it.
- sqlite: SQLite's online backup API on FerretDB's WAL database at an
  interval, storing only the pages that changed.
- files: attachments, avatars and logs by watching and by rescans, each
  content once under its SHA-256, links never followed.

Litestream (Apache-2.0) is an optional engine for SQLite: WeKan writes its
configuration and supervises a binary the administrator installed.

Segments are written whole, flushed and listed in append-only indexes.
A restore checks every index line, segment and blob first and writes
nothing when one is missing or changed; a database restore replays up to
the chosen moment, a file restore puts files back (add-missing or
replace-all), and a SQLite restore builds a checked file beside the stream,
never over the live one. Site administrators only; failures of the
unattended stream show in Admin Panel / Problems.

Tests: tests/continuousBackup.test.cjs; tests/integration/continuousBackup.test.cjs
against a real replica set, a real WAL database, real files and a stand-in
Litestream; server/lib/tests/continuousBackup.tests.js through the methods;
tests/playwright/specs/admin-continuous-backup.e2e.js on Chromium and WebKit.

Thanks to xet7 !
2026-10-03 01:47:42 +03:00
..

Admin Panel / Attachments

Where files live, how big they may be, moving them between storages, and backups. One heading per menu entry, in menu order. Backup is first and is the pane that opens; arriving there also asks once whether a backup is already running, so an in-progress backup shows its status.

Backup

See Backup.md for screenshots, restore steps and coverage limits.

Take a backup now — attachments, avatars and the database, each a checkbox — choose where it is written, and schedule it (daily, weekly on a chosen day, or monthly on a chosen date, at a chosen time). List backups shows what exists; a backup can be restored, either adding only what is missing or replacing.

A restored archive is checked entry by entry: an entry that resolves outside the directory it belongs in is skipped and reported, never written (ZipBleed).

Scope: the whole instance, or one Organization

Backup scope chooses what is backed up. A site admin sees Whole instance plus every Organization; an Organization's own admin sees only the Organizations they administer, and cannot take an instance backup.

An Organization's backup holds its boards and everything on them — lists, swimlanes, cards, comments, checklists, custom fields, activities, rules, integrations — and the attachments those boards use. It does not hold user accounts, the instance settings, or the Organization and Team documents themselves: those are shared by every Organization, so they belong to the instance backup.

Restoring an Organization's backup only ever writes to boards that Organization owns. Board ids the archive claims but the Organization does not own are dropped, every document is checked against what is left, and "replace all" replaces that Organization's documents rather than everyone's. An Organization's admin can never restore an instance backup, because it contains every Organization.

Instance archives are written to <files>/backup/YYYY/MM/DD/HH_MM_SS/backup.zip and an Organization's to <files>/backup/org/<orgId>/…, so the list shows only the archives you may restore. See Design / Multitenancy (D.8).

The schedule is instance-wide, and stays with the site admin: one cron, one archive of everything.

Continuous backup

Beside Backup: where Backup makes a whole archive at intervals, this streams every change - database, attachments, avatars and logs - to a directory within seconds, so a restore can return to any moment. Site administrators only. The settings (target directory, what to include, the database engine, intervals and retention), the status, the restore points and the restore are described in Continuous-Backup.md.

Move attachment

Move attachments and/or avatars between storages: choose the scope (attachments, avatars, both), the source (all, or one specific storage) and the destination. The last move is reported, and Repair file locations re-scans files whose recorded location no longer matches where they actually are.

Default save storage

Which storage new files go to.

Limits

Upload and download size limits, for attachments and for the API, each with a unit; and whether avatar uploads are blocked entirely.

MongoDB GridFS storage · Filesystem storage · S3 / MinIO storage · Azure Blob Storage · Google Cloud Storage

One pane per backend, each with its own read / write switches and its own settings — paths for the filesystem, bucket and credentials for S3 / MinIO, account and container for Azure, bucket and service-account permissions for GCS. Every pane says which environment variable or console path each field corresponds to.

Database migration

The MongoDB ↔ FerretDB v1 (SQLite) text-data migration, with the progress dashboard. See Problems / Migrations.

Sandstorm — removed from the menu

There is no Sandstorm pane any more. It only had content inside a Sandstorm grain — the MongoDB 3 → FerretDB migration status, disk usage per storage, and a button that deleted the raw MongoDB 3 files to reclaim grain disk. Compacting the MongoDB database frees that space as well, so WeKan does not offer to delete raw database files. The pane, its menu entry, its helpers and its handler are commented out in client/components/settings/attachments.jade and .js.

The grain migration itself is unchanged: it runs in sandstorm-src/start.js before the app boots — see Sandstorm migration.

The panes, in menu order

Every pane of this tab, in the order the menu shows them. The slug is what the address uses: /admin/attachments/<slug>.

Menu path URL slug Page
Attachments / Backup backup Backup.md
Attachments / Continuous backup continuous-backup Continuous-Backup.md
Attachments / Move Attachment move —
Attachments / Default Save Storage default-save-storage —
Attachments / Limits limits —
Attachments / MongoDB GridFS Storage gridfs —
Attachments / Filesystem Storage filesystem —
Attachments / S3/MinIO Storage s3 —
Attachments / Azure Blob Storage azure —
Attachments / Google Cloud Storage gcs —
Attachments / Database migration database-migration —

9 of these 11 panes have no page of its own yet. A dash is a gap to fill, not a pane that does nothing - what the pane shows is described in this README until somebody writes it up.