# Backups

termynl can keep a copy of the workspace in your own storage, and an owner can restore a backup into an empty termynl. Owners and admins set it up in **Settings → Workspace → Storage → Backup**. It is off until someone turns it on.

## What is copied, and where

-   **Where:** the workspace's own storage: the **S3** bucket, **Google Drive** or **OneDrive** chosen under [Storage](/admin/storage/). Backups need one of these; everything goes into this workspace's own folder there, `termynl-backup/w-<id>/`, with an `owner.json` file naming the workspace. Two workspaces or installs on one bucket or account each keep to their own folder; if a folder's owner file names another workspace, the run stops with a Last error and changes nothing.
-   **A Markdown copy, every 15 minutes:** docs, tasks and issues as Markdown files under `markdown/` in that folder, in the same folders and names as the sync folder. Only what changed is written again. File attachments stay links; their bytes stay in your storage.
-   **A full archive, once a day** at the hour you pick (UTC): the whole workspace in the export's format, edit history included unless you untick *Include edit history in the archive*, as `archives/termynl-YYYY-MM-DDTHHMMZ.tar.gz` in that folder. Backups keep one archive per day for the last N days (7 by default, 1 to 90), counting only days that have an archive: the newest archive of each day stays, and only older files with exactly that name pattern are deleted. **Run now** starts both copies; its archive replaces that day's. If a backup is already running (the scheduled one, for example), Run now says so and starts nothing.
-   **Personal items** (the private notes only each member can see) are left out unless an **owner** turns on *Include members' personal items*. That choice is checked again at every run: it stops when the owner who gave it is no longer an owner.
-   **Never read back.** termynl stays the only authoritative copy. Edits made to the files in the backup are ignored, and the next copy writes over them.
-   Secrets (tokens, keys, passwords) are never written to a backup.

## History and the size limit

-   Edit history makes the archive larger. The Backup card shows the size limit (20 GB by default, 1 to 1,000 GB) and how big a full archive would be now, and warns from 80% of the limit.
-   **Past the limit, older history is left out of that archive:** termynl keeps as many whole days of history as fit, newest first. The cut-off date shows in Settings next to each archive ("History from 2026-03-01 (older history trimmed to fit the limit)", or "Full history") and is recorded in the archive. After a restore, the History of an item from such an archive starts with "History before &lt;date> not in this backup".
-   If even the workspace without any history is over the limit, no archive is made and the card shows "Last error: Archive failed: over the backup size limit". Raise the limit.
-   Problems (storage disconnected, quota, sign-in expired) show as **Last error** on the card. A Markdown copy's error stays there until a Markdown copy succeeds, even when the archive works.

## Restore into an empty termynl

-   A restore only goes into an **empty** workspace: a fresh install, or one with only its owner and the starter content. The owner of that workspace does it, in the browser, in **Settings → Workspace → Data and export → Restore from a backup**. The card shows only while the workspace is empty. Tyn and MCP clients can't restore.
-   Pick an archive from the workspace's storage, or upload one (a backup archive or an owner's self-serve export). A new, empty workspace also sees the archives in other termynl folders on the same storage (an earlier install, for example), labelled by their owner file's name; restoring from there only reads them. **Check the backup** first: it reads the whole archive, writes nothing, and shows what comes back and who will be an owner or admin. Then type `restore workspace` and press **Restore**. An owner's export leaves out files over the size limit (listed under `skipped` in its `manifest.json`), and a restore can't bring those back from it: keep your own copy of them.
-   Items, members, settings, edit history and files come back, with the same ids and History. Items that were already deleted when the backup was made come back as History only. Nobody is emailed. If your account was matched to an account in the backup by email, the restore signs you out: sign in again with the same email to see the result.
-   **Where the files go:** on the hosted service, into the Google Drive, OneDrive, SharePoint, pCloud, Dropbox or S3 storage an admin chose in **Settings → Workspace → Storage**; choose one before you restore, because without it the files are skipped and listed in the restore report. On a self-hosted server, into the server's default storage; connect S3, Google Drive, OneDrive, SharePoint, pCloud or Dropbox again in **Settings → Workspace → Storage** if you used one.
-   **What to reconnect afterwards (hosted and self-hosted):** members sign in again with their email; mail sending, directory sync and single sign-on; connected apps, agents, devices, and calendar or mail accounts.

## Backups over MCP

Admins (scope `termynl:admin`) can use `get_backup_settings`, `set_backup_settings`, `run_backup` and `list_backups`. Restore has no MCP tool. Tyn has none of these.

<figure class="shot" data-screenshot="backup"><figcaption>Settings → Workspace → Storage → Backup</figcaption></figure>
