// CONTENTS Part 13 · Appendices

// PART 13

Migration guides

Chapter 54 / 56 3 min read English Part 13 of 14

Migration in General Bots means one of four concrete operations. This appendix gives the verified procedure for each; there are no cloud-vendor walkthroughs here because none of them can be verified against this repository.

1. Upgrading General Bots (version to version)

Schema moves forward via Diesel migrations at boot; binaries move via CI.

  1. Push the release to ALM — CI builds and deploys, restarting the service.
  2. On boot, main_module::migrations.rs applies pending migrations from botserver/migrations/ (211 directories at the time of writing) before the server accepts traffic.
  3. Verify: health endpoint answers, no E lines in the log after startup, targeted UAT in the browser.

Before a risky upgrade on a data-bearing host:

pg_dump -U postgres -F c -f /tmp/backup.dump botserver
incus snapshot create default-system pre-upgrade-$(date +%Y%m%d)

2. Host ↔ container (moving a component)

# host → container
pg_dump botserver > /tmp/backup.sql
./botserver --container
incus exec default-tables -- psql -U gbuser botserver < /tmp/backup.sql

# container → host
incus exec default-tables -- pg_dump -U gbuser botserver > /tmp/backup.sql
./botserver remove tables
./botserver install tables --local
psql -U gbuser botserver < /tmp/backup.sql

Host data mounts (botserver-stack/<component>/data|conf|logs/) mean an instance can be deleted and recreated without losing data.

3. Moving a bot between servers

A bot is a set of directories in Drive (.gbai buckets), not local files:

  • Standalone bots — copy the bucket {bot}.gbai (.gbdialog/, .gbot/, .gbkb/, .gbdrive/) to the target Drive with oc; the drive monitor discovers it on the next scan (30 s default, DRIVE_SCAN_INTERVAL).
  • Git-owned bots — the ALM repository is the source of truth. Point the new server’s git_bot_monitor at the repository; the Drive copy is materialized. Never hand-edit Drive copies of .gbdialog/.gbot.
  • Credentials — recreate the per-bot Vault path (secret/gbo/{org}/{branch}/{bot}) on the target; the LLM and channel settings do not travel with the bucket.

4. Cloud services → self-hosted components

The component mapping, with what actually changes:

You leave You land on What changes
Managed object storage OtterIO (or B2/R2/Wasabi via backend) S3 API is the same; point secret/gbo/drive at the endpoint, re-upload buckets
Hosted LLM APIs Any OpenAI-compatible endpoint (incl. local llama.cpp) set llm-url/llm-model/llm-key in Vault; restart
SaaS identity provider Zitadel (directory) users/groups re-provisioned; sessions re-issued
Managed email Stalwart (SMTP/IMAP) secret/gbo/email; DNS/DKIM records move with the domain
Managed vector DB Qdrant re-embed KB collections (embeddings are not migrated, they are regenerated)

Plan for the differences, not just the equivalents: you take over backups (pg_dump, snapshots), TLS (Caddy + ACME), and availability. Standard protocols are what make the move possible; the operational responsibility is what makes it real.

What is deliberately absent

  • No per-cloud vendor guides. They age weekly and cannot be verified against this repository.
  • No schema downgrade path. Migrations go forward; restore from backup if you must go back.
  • No automated bucket renaming. Org/workspace layout changes ({tenant}.gborg) are structural; move buckets deliberately, and remember the drive monitor derives bots from top-level .gb<marker> directories.

Found a mistake? Open an issue · All books

// SEARCH ESC
Pagefind · 236 pages · 4 books Enter to open ↑ ↓ to move