> ## Documentation Index
> Fetch the complete documentation index at: https://docs.studiograph.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Storage & backups

> Where a self-hosted workspace keeps its data, what to back up, and the one-command backup bundle.

## Storage backends for uploaded files

Entries are text, stored in a git repository at the workspace root. Uploaded files (images, PDFs, media) are **not** in git — they live in one of two backends:

* **Local (default)** — files are stored in `.studiograph/assets/` on the server volume and streamed from disk. Zero configuration.
* **Cloudflare R2** — files are stored in an R2 bucket and served via signed URLs. Configure it with `studiograph r2 setup`, or in the web app under **Settings → Providers → Asset Storage**. Bucket metadata (account, bucket, public URL) lives in the committed workspace config; the credentials live in the encrypted secrets store.

## What to back up

| Data                     | Where                                   | Why                                                                                   |
| ------------------------ | --------------------------------------- | ------------------------------------------------------------------------------------- |
| Workspace git repository | The workspace root                      | All entries — the content itself                                                      |
| Uploaded files           | `.studiograph/assets/` or the R2 bucket | Files are not in git                                                                  |
| `assets.db`              | Server volume                           | The file index — authoritative and **not rebuildable**                                |
| `auth.db`                | Server volume                           | Accounts and access                                                                   |
| `secrets.db`             | Server volume                           | Stored credentials — useless without `STUDIOGRAPH_MASTER_KEY`, so back up the key too |

Safe to lose (rebuilt automatically): the search index, collaboration state (`yjs-state/`), and caches.

## One-command backup

```bash theme={null}
studiograph admin backup
```

This produces a passphrase-protected `.sgbackup` bundle. Restore with:

```bash theme={null}
studiograph admin restore <bundle>
```

<Tip>
  If you back up the server volume yourself (volume snapshots, rsync), make sure the three databases above are included — the git repository alone is not a complete backup.
</Tip>

## Health checks

* `GET /api/health` — overall server health, including renderer status.
* `GET /api/health/dirty` — reports uncommitted workspace state.
