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>
1.5 KiB
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:
curl -fsS -X POST https://wiki.example.com/api/v1/admin/backups -H "Authorization: Bearer $TOKEN"
Restore
- Stop Docwell:
docker compose down. - Replace the contents of the
pb_datavolume with the contents of the backup zip. - Start Docwell again:
docker compose up -d. The search index rebuilds on its own.
Upgrades
-
Make a backup and download it.
-
Read the release notes for anything to do by hand.
-
Pull and restart:
docker compose pull docker compose up -dPin a version with
DOCWELL_VERSION=0.1.0in.envinstead of followinglatest.
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.