CI / go (Server) (push) Failing after 22m50s
CI / go (Web-App) (push) Canceled after 0s
CI / frontend (push) Failing after 8m47s
CI / desktop (ubuntu-latest) (push) Successful in 2h56m50s
CI / mobile (push) Failing after 5m33s
CI / docker (push) Successful in 1h43m8s
Docs / build (push) Successful in 16m2s
Docs / deploy (push) Skipped
CI / desktop (macos-latest) (push) Canceled after 0s
CI / desktop (windows-latest) (push) Canceled after 0s
docwell-db no longer needs a Docwell image: the stack runs tajniak81/pocketbase-docker-root as it is, and docwell-server does what the migrations and pb_hooks used to do inside PocketBase. On start, docwell-server now: - waits for PocketBase and imports Docwell's collections from an embedded snapshot (internal/pbschema). Existing collections and fields are matched by name, so their data is kept; the admin-managed users options (OAuth2 providers, magic link) are left untouched. - writes the DOCWELL_APP_NAME, DOCWELL_WEB_URL, DOCWELL_MAIL_FROM, DOCWELL_SMTP_* and DOCWELL_S3_* settings into PocketBase, as the boot hook did. It also replaces the hook's two routes: token checks use PocketBase's auth-refresh (the organization name is read as the superuser), and Docwell's own emails go out over SMTP from the server. PocketBase never returns the SMTP password, so the server keeps a copy in the superuser-only instance_settings collection; a password saved before this change has to be entered once more in the admin panel. Database/ keeps pb_migrations as the source of the schema; export-schema.sh regenerates the snapshot from them. Database/Dockerfile and pb_hooks are removed, the release no longer builds docwell-db, the AIO image runs PocketBase without migrations or hooks, and the compose files default DB_IMAGE to the stock image and pass the settings to the server instead of the database. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.5 KiB
Markdown
41 lines
1.5 KiB
Markdown
# Backups and upgrades
|
|
|
|
Everything that matters lives in docwell-db's data directory (the `pb_data` volume): the database, page history
|
|
and, unless files go to S3, the uploaded files. The search index in docwell-server's `/data` is rebuilt from it.
|
|
|
|
## Backups
|
|
|
|
In *Admin panel → Maintenance → Backups*, **Create backup** writes a zip of the database and its files into
|
|
`pb_data/backups`. Download it and keep a copy somewhere else: a backup on the same disk does not survive the disk.
|
|
|
|
Backups made while people edit are consistent: PocketBase copies the database safely while it runs.
|
|
|
|
For scheduled backups, back up the `pb_data` volume with your usual tools (for example a nightly `docker run` of
|
|
`restic` or `borg` against the volume), or call the API from cron:
|
|
|
|
```bash
|
|
curl -fsS -X POST https://wiki.example.com/api/v1/admin/backups -H "Authorization: Bearer $TOKEN"
|
|
```
|
|
|
|
### Restore
|
|
|
|
1. Stop Docwell: `docker compose down`.
|
|
2. Replace the contents of the `pb_data` volume with the contents of the backup zip.
|
|
3. Start Docwell again: `docker compose up -d`. The search index rebuilds on its own.
|
|
|
|
## Upgrades
|
|
|
|
1. Make a backup and download it.
|
|
2. Read the release notes for anything to do by hand.
|
|
3. Pull and restart:
|
|
|
|
```bash
|
|
docker compose pull
|
|
docker compose up -d
|
|
```
|
|
|
|
Pin a version with `DOCWELL_VERSION=0.1.0` in `.env` instead of following `latest`.
|
|
|
|
Database changes run on their own: docwell-server updates PocketBase's collections when it starts. Going back to an older version after a
|
|
migration is not supported; restore the backup instead.
|