1.0 migration tool final run error: x:SystemSettings defaultDomainId: references x:Domain/c

Your question

When trying to run the 1.0 migration tool -final I get
2026-10-29T15:35:25.889504Z ERROR migrate::orchestrator: run failed error=preflight check failed: settings conversion is incomplete; run prepare:
error: x:SystemSettings defaultDomainId: references x:Domain/c, which is not migrated, and cannot be cleared

-prepare was run beforehand and produced 4 answers.
rerunning -prepare shows only:
stalwart-migrate prepare: review how the v0.16 settings are converted to v1.
Press Enter to accept the value in brackets.

Summary: 46255 objects to write, 12 dropped, 61 warnings, 0 errors, 0 questions answered now.
Every question has an answer; run can start.

Write answers.toml and prepare-report.txt? [Y/n] Y

There is no mentain of default domain in the prep files. Default domain is configured in network settings and it’s our domain rather than “c”.
Is this some old configuration artefact and how could I remove it?

Stalwart is 0.16.27 on Windows Server.

Regards

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

This isn’t covered in the current docs. A community member or staff member will follow up.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

The c in x:Domain/c is the internal id of a Domain object, not its name, so it’s most likely your own domain: defaultDomainId points at it, and the run decided that domain isn’t being migrated.

Prepare checks the conversion against every object in the source, while run only converts the categories it’s migrating, and Domain belongs to the principals category. Those categories are recorded in the state database by the first run, so a later prepare doesn’t change them. If principals was left out (through --exclude, --include or the categories answer at the time of the first run), you get exactly this error on run while prepare reports 0 errors.

Please post the output of stalwart-migrate status --state <your state dir> (the categories line is the one I’m after) together with the exact run commands you used, including any --include or --exclude.

So initially /home/arja/.local/bin/stalwart-migrate prepare --source ‘/mnt/c/Program Files/Stalwart/migrate/config-source-wsl.json’ --state ‘/mnt/c/Program Files/Stalwart/migrate’

was used - the config .json is a temporary copy to get the path from WSL working

there was no include or exclude given and it had like just 4 questions on the first run.

Status:
/home/arja/.local/bin/stalwart-migrate status --state ‘/mnt/c/Program Files/Stalwart/migrate’
State database: /mnt/c/Program Files/Stalwart/migrate/state.sqlite
tool_version 1.0.3
edition enterprise
source_def_hash 6c9574d288996f246ce8d6bdd587f24d
target_def_hash 15b07cdd5e88615c64ec73b025b4e0e0
target_schema_version 7
categories settings
created_at 2026-10-29T15:29:49Z
source_store directory /mnt/d/Stalwart/rocksdb
target_claim 27e267017eac8dee75d1e40479195e4c
claim_generation 98dc002b1b788c741ad2aa3d206e989e
claim_generation_pending 98dc002b1b788c741ad2aa3d206e989e
final_done not done

Accounts: 0

Recent runs:
#2 final failed started 2026-10-29T15:34:55Z took 30s
error=“preflight check failed: settings conversion is incomplete; run prepare:\n error: x:SystemSettings defaultDomainId: references x:Domain/c, which is not migrated, and cannot be cleared”
#1 final failed started 2026-10-29T15:29:49Z took 31s
error=“preflight check failed: settings conversion is incomplete; run prepare:\n error: x:SystemSettings defaultDomainId: references x:Domain/c, which is not migrated, and cannot be cleared”

Reports in the latest run:
none

Reports in all runs:
none

ok and here the exact output from the initial prepare:
stalwart-migrate prepare: review how the v0.16 settings are converted to v1.
Press Enter to accept the value in brackets.

==== Data categories ====

Data categories to migrate
v0.16: Every category below exists in the source.
v1: Every category is selected by default. Categories can also be changed per run with --include and --exclude. The MTA queue and scheduled tasks are only copied by the final run, once v0.16 is stopped, so nothing is delivered or run twice.
Categories

  1. Settings [settings]
  2. Accounts, groups, domains and other principals [principals]
  3. Mailboxes, emails and submissions [mail]
  4. Calendars and events [calendars]
  5. Address books and contacts [contacts]
  6. Files [files]
  7. Sieve scripts [sieve]
  8. Identities [identities]
  9. Push subscriptions [push_subscriptions]
  10. Spam training samples [spam_samples]
  11. Received DMARC, TLS and ARF reports [reports]
  12. Archived items (enterprise) [archive]
  13. Learned spam filter models [spam_model]
  14. MTA queue [queue]
  15. Scheduled tasks [tasks]
  16. Metrics and tracing history [telemetry]
    (comma separated) [settings, principals, mail, calendars, contacts, files, sieve, identities, push_subscriptions, spam_samples, reports, archive, spam_model, queue, tasks, telemetry]: 1

==== Other settings ====

Changed defaults
v0.16: Some settings still have their v0.16 default value.
v1: v1 changed these defaults (cache sizes, report domain expressions, Pyzor, the SQL login query, the NATS port, connection pool sizes and others). Pinning keeps the v0.16 behaviour; inheriting adopts the v1 default.
Recommended: The recommended policy pins defaults whose change would alter behaviour (Pyzor, SQL login query, Redis user name, NATS port, log file prefix, OIDC display name claim) and inherits the rest.
Policy

  1. Recommended per setting [recommended]
  2. Keep every v0.16 default [pin]
  3. Adopt every v1 default [inherit]
    [recommended]: 1

==== Authentication ====

OAuth client registration (x:OidcProvider)
v0.16: With requireClientRegistration off (the default), v0.16 accepted any client_id at the authorization endpoint without a registration. With it on, only registered clients worked, and anonymousClientRegistration controlled whether anyone could register one.
v1: v1 rejects a client_id that is neither registered, a stateless id issued by its RFC 7591 registration endpoint, nor a Client ID Metadata Document URL. Applications that used an arbitrary unregistered client_id stop working after cutover until they are registered as OAuthClient objects. At the same time, v1 always accepts RFC 7591 registration of public clients under the anonymous HTTP rate limit (confidential clients need sysOAuthClientCreate), so a v0.16 restriction on registration cannot be kept.
anonymousClientRegistration: true
requireClientRegistration: false
Client registration

  1. Accept the v1 behaviour (register unregistered clients after cutover) [accept]
  2. Stop the migration [abort]
    [accept]: 1

New permissions
v0.16: Roles listed the permissions they grant; 37 permissions no longer exist in v1 and are removed.
v1: v1 adds permissions for IMAP and JMAP metadata, the metadata settings, connected OAuth applications, the search index queue and share cleanup tasks. Custom roles do not get them automatically.
New permissions

  1. Grant each new permission to roles that had the matching old one [grant]
  2. Do not grant them [none]
    [grant]: 1

Summary: 46255 objects to write, 12 dropped, 61 warnings, 0 errors, 4 questions answered now.
Every question has an answer; run can start.

That categories settings line explains it. In the first prepare, the data categories prompt is a multi-select where the numbers pick categories, so the 1 you typed there selected only [settings]. Every other question in prepare uses 1 for “accept the first option”, which makes this one easy to trip over. With only settings selected, the run doesn’t migrate any domains, and defaultDomainId in the system settings can’t point at one.

I also need to correct what I wrote earlier: the selection isn’t locked in by the first run. Every run reads it from answers.toml, and the state database only records it so the next run can tell when it changes. Prepare didn’t ask again on the second pass because that answer was already in the file.

To fix it, open answers.toml in your state directory (/mnt/c/Program Files/Stalwart/migrate), find the [global.categories] section and list every category you want:

[global.categories]
include = ["settings", "principals", "mail", "calendars", "contacts", "files", "sieve", "identities", "push_subscriptions", "spam_samples", "reports", "archive", "spam_model", "queue", "tasks", "telemetry"]

Then run stalwart-migrate prepare --non-interactive with the same --source and --state to check the answers, and start the run again with the same state directory. Both earlier runs stopped at the preflight check before writing anything, so there’s nothing to clean up first. The categories are described in Data categories if you’d rather leave some of them out.