Concepts
Vandelay moves a mail system to Stalwart as a project: a directory that holds the plan of the migration, its state, and a copy of every account in transit. The same project can be driven from the web interface, the terminal interface or the command line, and each of them shows the same steps and the same state. This page introduces the terms the other migration pages rely on.
Project
Section titled “Project”A project is a directory on the Vandelay host. It is created with a scope, which decides what the project migrates and cannot change afterwards:
- Whole server (
server): every account that the source lists, together with its domains, aliases, groups, mailing lists and DKIM keys. This is the usual scope. - Single account (
account): one account of the source into one account on Stalwart. It suits moving a user between servers, or a source that cannot list its accounts. Domain-wide settings such as catch-all addresses are never touched.
The directory holds these entries, all created readable only by their owner:
| Entry | Content |
|---|---|
plan.toml | The plan: target, source, selection and options |
state.sqlite | Accounts, tasks, losses, conflicts, pre-flight reports and the audit log |
secrets.vault | The encrypted secret store |
accounts/ | One archive per account |
logs/ | The runner log and one log per account |
reports/ | Reports and downloads, such as user lists and temporary passwords |
runner.json | Present while a runner holds the project |
Because the archives hold a full copy of every account’s mail, the project directory needs as much free disk space as the accounts it holds at the same time, and its backups need the same care as the mail store itself.
The plan is the file plan.toml. It records what the operator chose in each step: the Stalwart target, the source system and its access, the accounts to migrate, the data types, how accounts and passwords are provisioned, and the cutover strategy. Every front end edits the same file: the steps of the web interface and the terminal interface save into it, vandelay migrate target, source, select and options set their step’s fields, and vandelay migrate set key=value sets any key by name. The file can also be edited by hand and applied with vandelay migrate plan reload, or the hand edit thrown away with vandelay migrate plan discard. Plan file lists every key.
Four parts of the plan identify the migration: the target server, the source server, the proxy and the cutover mode. They are bound the first time work starts, after a pre-flight that passed, and can no longer be changed, because the copied accounts and the recorded state refer to them. The source system is fixed even earlier, once accounts are discovered, and a change is refused with the source system is fixed once accounts are discovered; create a new project to migrate from another system. An attempt to change one is refused with the source cannot change after the migration has started: this project uses <identity>; restore it, or create a new project for another server. Credentials, certificate pins and every other option stay editable.
Secret references
Section titled “Secret references”The plan never holds a password, token or key. A field that needs one holds a reference instead:
env:NAMEreads the environment variableNAMEof the runner when the secret is needed.file:PATHreads the file; a relative path is resolved against the project directory.askasks the operator in whichever front end is attached. The runner keeps the answer in memory until it stops, the server refuses it, or that section of the plan changes, so a new runner asks again.
A literal value is refused with expected a secret reference (env:NAME, file:PATH or ask); clear-text passwords are not accepted.
The secret store, secrets.vault, holds the temporary passwords that Vandelay sets on the accounts it creates in Stalwart, so that they can be handed to users later. It is encrypted with a key derived from a passphrase, or taken from a key file of 32 random bytes in base64. The runner starts only once the store is unlocked: commands unlock it with --key-file, then with the VANDELAY_SECRETS_PASSPHRASE environment variable, and otherwise ask for the passphrase on the terminal. A runner without a terminal needs one of the first two. The store is kept until the operator wipes it, from Finish or with vandelay migrate secrets wipe, once the temporary passwords are no longer needed.
Runner
Section titled “Runner”All work of a project runs in its runner: discovery, pre-flight, copies, switches and verification. One runner holds a project at a time, and the front ends talk to it rather than doing the work themselves:
vandelay serveandvandelay tuihost the runner of each project they open, and keep it running while they are open.- A CLI command starts a runner for its own work when none is running, follows its tasks until they end, and lets the runner exit afterwards. Ctrl-C asks it to stop after the current step of each task, and a second Ctrl-C exits at once with exit code 8.
- A CLI command run while a TUI or web interface holds the project sends its request to that runner and follows the tasks. Ctrl-C then only detaches: the work continues, and
vandelay migrate stopstops it.
Prompts from the runner, such as an ask secret, reach every attached front end, and the first answer wins. A runner started without any front end that can answer fails the waiting work after a short grace period, which is why unattended runs use env: and file: references.
Account states
Section titled “Account states”Each account moves through a sequence of states, which the dashboard and vandelay migrate status show:
| State | Meaning |
|---|---|
| Discovered | Listed by the source |
| Selected | Chosen for the migration |
| Archiving | Being read from the source into its archive |
| Archived | Its archive holds a full copy (zero-downtime mode) |
| Provisioned | Created on Stalwart (one-shot and copy-only modes) |
| Copying | Being written to Stalwart (one-shot and copy-only modes) |
| Copied | Its data is on Stalwart (one-shot and copy-only modes) |
| Switching | A switch step is in progress |
| Switched | Its users are served by Stalwart |
| Verified | Verification passed or was accepted |
| Completed | Closed: no more delta passes |
| Skipped | Left out, with a reason |
The path differs between the two cutover strategies. In a zero-downtime migration, an account is archived and kept current with delta passes, and it is created and written on Stalwart only during its switch. In a one-shot migration, every account is created and copied to Stalwart before the MX change, and the switch is the final copy after it. A project with the strategy “Copy only, no cutover” copies the accounts and stops at Copied.
An account is Skipped for one of five reasons: the operator left it out, its address conflicts with an existing one, it already exists on Stalwart and the plan skips existing accounts, it is disabled on the source, or it holds no data. Disabled and empty accounts are skipped only when the selection leaves them out (“Include disabled accounts” and “Include accounts with no data”). A disabled account that is migrated is created on Stalwart with its login disabled, keeps receiving mail as it did on the source, and is shown as “(disabled on the source)”.
Archive
Section titled “Archive”Vandelay never copies directly from the source to Stalwart. It reads each account into an archive, a SQLite file under accounts/ that holds the account’s mail, folders, Sieve scripts, calendars, contacts, files and settings, and it writes Stalwart from the archive. The archive makes every copy convergent: an interrupted read or write is resumed by running it again, and a later delta pass reads only what changed on the source since the previous pass. It also decouples the two ends, so that a slow source and a busy target never hold each other up.
Archives are the same format that the per-account import and export commands use, and vandelay migrate inspect shows the contents of one. Finish deletes the archives of completed accounts.
Losses
Section titled “Losses”A loss is something the source holds that cannot be migrated to Stalwart: a rule that has no equivalent, a setting Stalwart does not have, an item that cannot be read, or a directory entry with no counterpart. Each connector reports the losses it knows of. Losses that apply to the whole server are found at discovery, and losses of single items during the copy.
Losses are listed in pre-flight under “Items that cannot be migrated”, on the Verify and report screen, and in the report written by vandelay migrate report. Each source page lists the losses of its system, so that they can be reviewed before the migration starts.
No rollback
Section titled “No rollback”Vandelay only reads the source and never deletes anything from it, so the source keeps a copy of every account as it stood when the account moved. Vandelay itself, however, has no rollback and no abort. Once an account is switched, its logins stay mapped to Stalwart, and no command moves them back. A switch that fails before the logins are mapped can be given up with skip, which only changes Vandelay’s record: the account already created on Stalwart stays, and because its address is now local there, mail for it is delivered on Stalwart until the account is deleted by hand. Failed steps describes the choices at a failed step.
Finished project
Section titled “Finished project”A migration is finished once Finish has run after the last account was closed. From then on, the runner stops and the project opens read-only on Verify and report: its settings can no longer be saved, detection does not run, and the report and downloads stay available. Finish itself is shown as done, with Done: Finish ran and the migration is finished. A finished project no longer opens its secret store, so the temporary passwords are not downloaded from it; if the store was not wiped, vandelay migrate export-temp-passwords still writes them, and vandelay migrate secrets wipe removes the store afterwards.