Planning
A migration is set up step by step in Vandelay, but several of its decisions depend on the organisation rather than on the servers: whether users may notice the move, how they sign in afterwards, and who tells them. This page lists those decisions, so that they are settled before the project is created. The fields named here are set in the steps described in Server migration.
Scope and strategy
Section titled “Scope and strategy”The scope of a project is fixed at its creation. A whole-server project migrates every account the source lists, with its domains, aliases, groups and lists; a single-account project migrates one account into one account and leaves domain-wide settings alone. Concepts compares the two.
The cutover strategy decides how users move to Stalwart once their data is copied, and it is bound when work starts:
- Account by account through the migration proxy (
proxy). Accounts switch one at a time behind the Stalwart proxy, while the source keeps serving the others. Users keep their server name and see one disconnection. This needs a self-hosted source that the proxy can sit in front of, and it is described in Zero-downtime migration. - Whole domains by MX change (
domain). Every account is copied while users keep working on the source, then the MX records and client settings of each domain move to Stalwart at once, and a final pass copies what arrived in between. It suits hosted services and any source the proxy cannot front, and it is described in One-shot migration. - Copy only, no cutover (
none). Vandelay copies the accounts and leaves the cutover to the operator, for example to prepare a test environment or to copy into accounts that are already in use.
Passwords
Section titled “Passwords”Users sign in to Stalwart with credentials that Vandelay provisions, and the “Passwords” setting (provisioning.passwords) decides which:
- Keep existing passwords where possible; temporary password otherwise (
carry-or-temporary). Vandelay reads each account’s password hash from the source and stores it on Stalwart, so the user’s password keeps working. An account whose hash cannot be read, or uses a scheme Stalwart cannot verify, gets a temporary password instead. Each source page says which hashes its system exposes. Passwords that a source stores in clear text are carried only when “Carry clear-text passwords” is on; they are hashed before they reach Stalwart. - Temporary password for everyone (
temporary). Every account gets a generated password. Hosted services such as Microsoft 365 and Google Workspace never expose password hashes, so their accounts always end here unless an external provider signs users in. - No passwords: an external identity provider signs users in (
external). Vandelay sets no password, because users sign in through an OpenID Connect provider or another directory configured on Stalwart.
Temporary passwords must reach users before their accounts switch. vandelay migrate export-temp-passwords writes them to a file encrypted with age. The switch offers a confirmation that they were delivered, but does not require it, so the delivery is the operator’s responsibility.
DKIM keys
Section titled “DKIM keys”Mail that Stalwart sends for a migrated domain must be signed with a key that is published in the domain’s DNS. The “DKIM keys” setting (provisioning.dkim) decides, per domain, whether Vandelay imports the source’s keys, generates new ones, or does nothing:
- Import keeps the existing selectors and DNS records, so nothing changes in DNS. It needs a source that exposes its keys, which each source page describes.
- Generate creates new keys on Stalwart. Their public keys must be published under new selectors before the first message is sent from Stalwart, next to the old ones, which keep verifying mail the source still sends.
- Skip leaves signing to the operator, as described in DKIM.
Existing accounts
Section titled “Existing accounts”Stalwart may already hold some of the accounts, for example from a test run or from a directory. The “Accounts already in Stalwart” setting decides whether Vandelay uses such an account as the target and adds the missing aliases (use), or skips it (skip). Pre-flight lists every address that conflicts with an existing account, alias or list on Stalwart, with the resolution it will apply.
Data to copy
Section titled “Data to copy”Mail, calendars, contacts, files, Sieve scripts, rules, vacation responses, identities and forwarding are each a switch in the “Data to migrate” step. Junk and Trash can be left behind, and folder filters (regular expressions on the folder name) narrow the copy further. Leaving large folders out shortens the migration, but anything not copied before the source is decommissioned is lost. Data that a source holds but Stalwart cannot represent is reported as a loss, and each source page lists those of its system.
Stalwart limits
Section titled “Stalwart limits”Vandelay writes many objects from one host in a short time, which is the pattern that Stalwart’s rate limits and automatic banning are meant to stop. Two defaults keep them out of the way. Vandelay adds its own address to Stalwart’s allowed IP addresses for the duration of the migration (“Allow vandelay’s address”, target.allow_ip), which exempts it from the authenticated rate limit and from banning. Provisioning adds the address Stalwart sees for the Vandelay host, valid for 7 days, and the copies extend it daily; Finish removes exactly the entries the project created. An address that Stalwart already allows through another entry is left alone. No entry is added when Vandelay reaches Stalwart over loopback, or when it reaches a public Stalwart address from a private one (NAT, a proxy or a container network), because Stalwart then sees another address: the run log says so, and the address Stalwart sees is added to its allowed IPs by hand. And the default administrator holds the unlimitedRequests and unlimitedUploads permissions, which lift the JMAP request and upload limits; pre-flight reports this as superuser: the upload and request limits do not apply.
An administrator account without these permissions, or a project with the allowed-IP entry turned off, runs into the limits instead. Pre-flight then reports not a superuser: the upload and request limits apply, together with the limits it found. In that case, raise the following on Stalwart for the migration and revert them afterwards:
rateLimitAuthenticatedof Http, 1000 per minute per account by default, which a large account exceeds.maxUploadSizeof Jmap, 50 MB by default, which must exceed the largest message or file being copied.maxConcurrentRequestsandmaxSetObjectsof Jmap, which bound how fast one account is written.
Failed authentications and rejected recipients from an address that is not allowed still count towards the ban thresholds of Security, so a mistyped password in a script can ban the host that runs it.
DNS and certificates
Section titled “DNS and certificates”Stalwart becomes the public mail server of the migrated domains, either at once in a one-shot migration or from the moment the proxy goes live. Before that point, the SPF records must authorise Stalwart, Stalwart’s certificates must cover the public names, the autoconfig and Autodiscover names should point at Stalwart, and DANE records must include Stalwart’s key. Lowering the TTL of the MX records and the public server name a day in advance shortens the time during which some clients still reach the old server. DNS records and Setting up clients describe what Stalwart needs. Each cutover page lists the records that matter for its strategy.
User communication
Section titled “User communication”Users notice the migration in two ways: their clients download the mailbox again, because Stalwart assigns new identifiers, and, when they did not keep their password, they need a new one. vandelay migrate export-users writes one row per account, group and list, with the address, the password mode and the switch time, as CSV, JSON or LDIF. The CSV feeds a mail merge, and vandelay migrate guide mail-merge prints a message template with the client settings to send. Users coming from a hosted service also need to remove the provider’s own account type from their devices, because such an account keeps connecting to the old provider.
Test run
Section titled “Test run”Every project runs pre-flight before work starts. Pre-flight checks the target, the source, the proxy, the selected accounts, the free disk space and the conflicts, and it dry-runs a sample of accounts: three by default, or up to 50 with vandelay migrate preflight --sample N on the command line. The sampled accounts are dry-run one after another, so each one adds its own dry run to the time pre-flight takes. A test account on the source, migrated end to end in a single-account project before the real migration, shows how clients behave after a switch.