Reinstalling Stalwart

Your question

Im currently on v0.13.x and due to the breaking changes, I want to do a fresh install of 0.16.x.

I know I can use imapsync to do backup but is it possible to backup all mailboxes at one and not transfer one after the other using imapsync?

When a new instance have S3 configured, does all the backup imported email goes to the S3 or uses the local storage?

Any idea of what to put into consideration doing this?

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

Here are answers to each of your questions:


Backing up all mailboxes at once

imapsync itself handles one mailbox at a time, but it does support a --file or loop-based approach to migrate multiple accounts in a single script run – this is a feature of imapsync, not Stalwart. The Stalwart docs don’t cover imapsync batch usage, so for that you’d consult the imapsync documentation directly (it supports processing a CSV of accounts).

However, a potentially better option for your case – since you’re doing a full reinstall – is Stalwart’s built-in Database Import/Export utility. It can create a binary dump of the entire internal database (including all blobs/emails) and restore it to a fresh instance, even with a different backend. The key caveats:

  • The server must be stopped before running export or import.
  • It is a migration tool, not a general backup solution.
  • Since v0.13 is architecturally quite different from current versions, check whether this cross-version import path is supported before relying on it – a community member or staff may need to confirm this.

Export command example:

/opt/stalwart/bin/stalwart --config /path/to/config.json --export /path/to/export-directory

Import on the new instance:

/opt/stalwart/bin/stalwart --config /path/to/config.json --import /path/to/export-directory

Does imported email go to S3 or local storage on the new instance?

All data (including imported emails) goes wherever the new instance’s BlobStore is configured to point. If you configure S3 as the blob store before importing, blobs will land in S3. If you configure a local filesystem backend, they go local. The storage backend is determined entirely by the new instance’s configuration – not by where the data came from.


Key things to consider for the migration

  • v0.16 has multiple breaking changes from 0.13. The official guidance is to read the upgrading notes in full before proceeding.
  • Spin up a fresh v0.16 instance in a VM or container first to get familiar with the new WebUI and configuration format before touching production.
  • Configuration is no longer TOML/INI – it’s managed via the WebUI or CLI using JSON objects.
  • Decide your storage backend (S3 or local) and configure it before any import or data transfer.

Docs referenced: Database Migration, S3 Blob Store, Upgrading

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong. If you found it useful, mention @helpbot in any reply to ask follow-up questions and the bot will respond again.

The 0.16 migration tooling only runs against 0.15.x, so fresh-install plus mail transfer is reasonable from 0.13. A couple of specifics:

There’s no built-in bulk-import tool in 0.16; the old stalwart-cli import is gone. The practical route is parallel imapsync runs, one per account, driven from a small shell script that reads a user/password list.

On the S3 question: the BlobStore singleton in 0.16 selects one backend for all blobs. If it’s set to S3, every blob (including those imported via IMAP APPEND) lands in S3, never on local disk. Local disk is only used if BlobStore is set to Filesystem or to Default (which reuses the data store).