Your question
Hello,
I’m using Stalwart Enterprise with Stalwart Management UI v0.1.33.
I’m planning to migrate my production environment from the default RocksDB storage to PostgreSQL, and I’d like to know the recommended approach.
Since this is a live production environment, what would be the safest migration strategy?
- Is it safe to migrate directly while staying on my current Stalwart version?
- Or is it recommended to upgrade to the latest version first and then perform the database migration?
If upgrading first is the recommended approach, are there any official guides or best practices for safely upgrading and migrating a production environment?
I’d appreciate any recommendations or references to ensure the migration is performed with minimal risk and downtime.
Thank you!
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
Hello, @stalwart could you please share your recommendations for my case? I would really appreciate any advice or best practices you can provide. Thank you very much!
For moving from RocksDB to PostgreSQL, use the built-in database export/import utility, and note it’s an offline operation rather than a live migration: stop Stalwart, --export the current store to a directory, switch the data store config to PostgreSQL, then --import that directory. It’s a raw dump, so it has to run with the server stopped, and export and import must be the same binary version. Details at Database Migration | Stalwart.
Because of that same-version requirement, do the backend swap on your current version as its own step, verify it, and treat any version upgrade separately, rather than combining the two. The one exception: if you’re also planning to cross the 0.15-to-0.16 boundary, that upgrade is itself a side-by-side migration to a fresh instance (Overview | Stalwart), so you’d just stand the new instance up on PostgreSQL from the start and skip the export/import entirely. Which is the better plan depends on your current server version, so let me know what you’re actually running (the server version, not the management UI version). Enterprise versus Community makes no difference here, and keep your normal PostgreSQL and RocksDB backups, since the dump isn’t one.