How to Migrate hMailServer or MailEnable to a New Server Without Losing Mail

This guide is for admins who run hMailServer or MailEnable on an old Windows machine and need to move it to a new one without losing mail. The short answer: both products keep state in more than one place, so a migration is never just “copy the mail folder”. For hMailServer you move the database and the data directory together and keep the version identical. For MailEnable you install the exact same version on the new server and copy the Config and Postoffices folders, optionally with a registry export. Do the first sync while the old server is still live, then a short final sync at cutover, then change DNS.

The steps come from the vendors’ own documentation (hMailServer’s documentation on GitHub, MailEnable’s knowledge base). Not tested yet: we have not run these migrations ourselves, so rehearse on a spare machine first.

What each product keeps, and what you must move

ItemhMailServerMailEnable
ConfigurationThe SQL database (accounts, domains, settings, links to messages) and hMailServer.iniThe Config folder; optionally the HKLMSOFTWAREMail Enable registry key
MessagesThe data directory (IMAP folders and undelivered messages)The Postoffices folder
Optional extrasEvents directory, log directoryBad Mail, Logging, Queues, and Dictionaries on paid editions
Version ruleA backup made in one version cannot be restored in a different versionInstall the same MailEnable version, including the minor version, on the new server
LicenceFree, open source (AGPL-3.0)Standard edition free; paid editions need an updated licence key on the new server

Before you start: the checks that save the weekend

  1. Write down the version of the old server. hMailServer’s documentation states that a backup made in one version cannot be restored in a different version, and that there is no downgrade path. Install the same version on the new machine first, and upgrade afterwards if you want 5.7.1, not during the move.
  2. Lower the TTL on your MX and mail host names a day or two ahead, so the DNS change at cutover takes effect quickly. This is general DNS practice, not a vendor step.
  3. Plan the new IP. If the public address changes, update PTR and SPF records first, or large providers will reject your mail.
  4. Take a full backup and keep it until the new server has run for a few days.
  5. Pick an off-hours window; the final sync needs the old services stopped. Test local delivery, inbound, outbound and IMAP login on the new server before changing MX.

Migrating hMailServer

hMailServer’s documentation names the things to back up: the database, the data directory, and other files such as the Events directory, the hMailServer.ini file and the log directory. The database holds all configuration and the links to the messages; the data directory holds the messages themselves, including undelivered ones and IMAP folders.

Small server: use the built-in backup

The built-in backup makes a compressed file that can include settings, domains and messages. The documentation says it is designed for small installations and strongly recommends external tools above 50 accounts or 10,000 messages. It skips messages in the delivery queue. Restore it on a new server that runs the same version.

Larger server: move the database and data directory

This sequence is our assembly of the documented parts, not a single vendor procedure:

  1. Install the same hMailServer version on the new server and point it at an empty database of the same type. For production, the documentation steers you to MySQL, MariaDB, SQL Server or PostgreSQL rather than the bundled Compact database, which is limited to 4 GB.
  2. Pre-copy the data directory while the old server runs. The documentation suggests robocopy for this: copy while the service is running, then stop the service and copy again, which only transfers the changes and shortens downtime. It also warns that robocopy can cause disaster with the wrong switches, so put the source first and read the options before using a mirror switch:
    robocopy "D:hMailServerData" "\newserverd$hMailServerData" /E /R:1 /W:1 /MT:8
  3. At cutover, stop the hMailServer service on the old server. A stopped service is the safe state; a hot copy can miss a half-received message.
  4. Dump the database. For MySQL the documentation points to mysqldump; for SQL Server, its built-in backup tools. Restore the dump into the new database.
    mysqldump -u root -p --single-transaction hmailserver > hmailserver.sql
  5. Run the final data-directory copy, then check the DataFolder setting in the Directories section of hMailServer.ini on the new server. The documentation describes this setting for relocating the data directory, and notes the move works only when the diagnostic tests report that relative message paths are stored in the database for all messages.
  6. Start the service, open the administrator console, and send and receive a test message before you change DNS.

Migrating MailEnable

MailEnable’s knowledge base is explicit that its backup utility is meant to recover the same server, not to migrate to another one, and gives a separate migration procedure. The main points of that procedure:

  1. Install the exact same version, down to the minor version, on the new server. If the new server’s version is older, the knowledge base says to follow its downgrade procedure first.
  2. Registry copy is optional and conditional. It works only if the versions match, the Windows architecture is the same (32-bit to 64-bit is unsupported) and the install paths are identical. Export HKLMSOFTWAREMail Enable (HKLMSoftwareWow6432NodeMail Enable on 64-bit Windows) and import it on the new server. Afterwards, recheck service IP bindings, the SMTP outbound IP binding and, on paid editions, the NetBIOS name and CPU count tied to the licence key.
  3. Recreate IIS. Webmail and web administration run under IIS. The knowledge base says not to copy applicationhost.config between servers. Install the role first:
    Install-WindowsFeature Web-Server -IncludeManagementTools
  4. Export and import SSL certificates, including private keys, and set permissions as the knowledge base describes.
  5. Stop all MailEnable services on both servers. On the old server, also set the Mail Transfer Agent service to Disabled so it does not return after a reboot.
  6. Copy the folders from the install directory (default C:Program Files (x86)Mail Enable): Config and Postoffices are mandatory; Bad Mail, Logging, Queues and, on paid editions, Dictionaries are optional.
  7. Fix permissions with icacls: the knowledge base gives full control for the IME_ADMIN and IME_SYSTEM groups on Config, Queues, Bad Mail and Logging, and for IME_ADMIN and IME_STORE_GROUP on Postoffices, with inheritance.
  8. If password encryption is enabled, export the Encryption Key value under the Authentication provider key and import it on the new server.
  9. Start services on the new server, create a test post office and mailbox, and confirm webmail and a client can send to an external address.
  10. Change the MX records. While DNS propagates, the knowledge base says to start only the SMTP Connector on the old server and to copy its QueuesSMTPInbound folder to the new server periodically, so late-arriving mail is not stranded.

Large mail stores

MailEnable’s second article recommends syncing with robocopy ahead of cutover, live first and again after services stop. FTP does not preserve creation dates, and IMAP clients re-download a folder when its index file date changes, so copy index files with timestamps intact.

Client side effects to expect

  • MailEnable’s knowledge base says POP3 clients may re-download mail if the server’s IP changes, and the downloaded messages appear unread.
  • If users connect to the new server before the final sync finishes, message flags can be lost. Block client access until you are ready.

If you run MailEnable Standard and spam is a problem, Xeams can act as a filtering front end; more mail tools are in the cloud and SaaS administration tools hub.

Limitations

  • hMailServer’s built-in backup is not intended for large servers, and the data-directory move relies on relative message paths being stored in the database.
  • MailEnable’s registry copy is conditional, and paid editions need a licence key update for the new server. ActiveSync is not part of the Standard edition.

FAQ

How do I migrate MailEnable to a new server?

Install the same MailEnable version on the new server, stop services on both, copy the Config and Postoffices folders (optionally the registry key), fix folder permissions, start services, then change MX records. The vendor’s own backup utility is for the same server only.

How do I move hMailServer to a new server?

Install the same version, move the database and the data directory, check the DataFolder setting in hMailServer.ini, and test before changing DNS. For small servers the built-in backup can do the work if both servers run the same version.

Can I restore an hMailServer backup on a newer version?

The documentation says a backup made in one version cannot be restored in a different one. Restore on the same version, then upgrade.

Does MailEnable Standard need a new licence on the new server?

Standard is free. Paid editions need an updated licence key for the new server, according to the vendor’s migration article.

Last updated: 17 October 2026 · AdminHub Plus editorial team. Licence, version and platform details are checked against each developer's official documentation.

Send a Message