# Moving a community and backups

> Hand a community to a new host with zaun-host export and import, and what members see.

A community belongs to its owner, not to its host. Moving it takes three steps:

1. **The owner signs a new delegation** naming the new host (from their app), and publishes it on
   the old host, so members learn where to go.
2. **The old host's operator exports** the community:

   ```sh
   zaun-host export --data-dir D --community <ID> --out community.zaun --passphrase-file pass.txt
   ```

   The bundle holds the members, roles, channels, bans, admission policy, history, audit log and
   attachment files, is signed by the old host and encrypted with the passphrase (mode 0600, at
   least 16 bytes). Invitation secrets never leave. Stop `run` first.

3. **The new host's operator imports** it:

   ```sh
   zaun-host import --data-dir D --passphrase-file pass.txt community.zaun
   ```

   The import checks every signature and hash first, and that the owner's delegation names this
   host. If the owner published the delegation after the export, pass it with
   `--descriptor F` (JSON with `descriptor` and `delegation`). Stop `run` first.

Members' apps follow on their own (`communityMoving`, then `communityMoved` events in
`zaun-client`) and keep their identity, roles and history. Bans stay in force.

## Backups

An export is also a backup of one community. Back up, too:

- `host.key`: without it, owners must delegate to a new host key;
- the owner's client directory: the community's **root key** lives there, and nothing can replace it.
