Skip to main content

Backup + Migration

❓ I installed BookStack via Docker (as in the guide). Could you please explain how to create backups (a complete content backup) so that I can migrate the website if needed, e.g., to another server/domain? Here is BookStack’s official guide.

Full BookStack Backup (Docker) — so a move to another server/domain works 🧰📦

For a complete, restorable backup, you essentially need two components:

  1. Database (all pages, books, users, permissions, settings …)
  2. Files/config (uploads, attachments, .env/APP_KEY, possibly themes/modules)

Since your setup matches your guide (/opt/bookstack with docker-compose.yml, volumes ./mariadb and ./bookstack), this is pleasantly simple.


✅ What exactly needs to be backed up?

1) Database (MariaDB)

  • The content is in the DB container, and in your setup it’s persisted under:
    • ./mariadb (as the volume ./mariadb:/config)
  • Cleanest approach: SQL dump (portable, tolerant across versions)

2) Files (BookStack container volume)

  • Persistent data is stored under:
    • ./bookstack (as the volume ./bookstack:/config)
  • In particular, these are important:
    • .env (including the APP_KEY!)
    • uploads/attachments
    • possibly www/themes/custom/... (your tweaks/modules)

3) Compose/Caddy (helpful for migration)

  • docker-compose.yml
  • Caddyfile
  • Caddy data (optional):
    • ./caddy/data & ./caddy/config (certificates/state).
      Not strictly required, but sometimes saves you from re-issuing / rate limits.

🗂️ Create a backup (recommended approach)

Assumption: the project is in /opt/bookstack and the containers are named as in your YAML:
bookstack-mariadb and bookstack.

Step 1: Create a backup folder

cd /opt/bookstack
mkdir -p backups