---
title: "How to Migrate Maildir Emails from a Plesk Server to an ISPConfig Server"
description: "Migrate Maildir mailboxes from a Plesk server to an ISPConfig server with rsync, then fix ownership and reindex with Dovecot, one user at a time or in bulk."
url: "https://docs.noiz.ie/ispconfig/how-to-migrate-maildir-emails-from-a-plesk-server-to-an-ispconfig-server/"
section: "ISPConfig"
categories:
  - "Control Panels > ISPConfig > Email"
last_reviewed: "27 July 2026, against the ISPConfig release Noiz runs and Plesk Obsidian on Debian GNU/Linux 12 (bookworm), with Dovecot as the destination IMAP server"
---

# How to Migrate Maildir Emails from a Plesk Server to an ISPConfig Server

This guide walks you through migrating Maildir email accounts from a Plesk source server to an ISPConfig destination server, moving all email data (user mailboxes, folders, and read/seen state) across intact. It is an administrator-level procedure intended for server operators performing a platform migration at the shell, not a client-area task.

The workflow is the same in both directions: stop the mail services, copy the Maildir tree with `rsync`, correct ownership, restart Dovecot, and reindex. Two approaches are covered: migrating users one at a time (best for small moves or a first test run), and a bulk pass that migrates every mailbox under a domain in a single loop.

**Last reviewed:** 27 July 2026, against the ISPConfig release Noiz runs and Plesk Obsidian on Debian GNU/Linux 12 (bookworm), with Dovecot as the destination IMAP server. This guide is written for Noiz hosting and is kept current against ISPConfig and Dovecot. It complements, and does not replace, the official documentation linked below.

### Official Documentation Reference

- [ISPConfig Documentation](https://www.ispconfig.org/documentation/) (mail domains, mailboxes, and the remote API)
- [Dovecot Documentation](https://doc.dovecot.org/) (`doveadm index`, `doveadm quota`, and Maildir handling)
- [rsync manual page](https://download.samba.org/pub/rsync/rsync.1) (transfer flags, ownership mapping, and exclusions)

## Prerequisites

Before you begin, make sure the following assumptions and preparations are in place:

- The commands below assume Debian GNU/Linux 12 (bookworm), Plesk Obsidian on the source server, and ISPConfig 3.3.1p1 on the destination server. Different distributions or major versions may need adjusted paths.
- Every destination mailbox must already exist in ISPConfig **before** you copy any data. Create each one through the ISPConfig control panel (or via the remote API) so the database records and on-disk directory structure (`/var/vmail/domain/user`) are in place. Copying data into a mailbox that ISPConfig does not know about will not authenticate, because the matching row in the `mail_user` table is missing.
- The paths and ownership used below are the ISPConfig defaults. Confirm them for your own server under **System > Server Config > Mail**, which holds **Maildir Path** (default `/var/vmail/[domain]/[localpart]`), **Homedir Path** (default `/var/vmail`), and **Mailuser Name** and **Mailuser Group** (both default `vmail`). **Maildir Path** is the mailbox home; Dovecot keeps the messages themselves in a `Maildir` subdirectory of it, which is why the ownership commands below target `/var/vmail/test.co.za/test/Maildir` rather than the home itself. The same tab holds **POP3/IMAP Daemon**, which ISPConfig can set to either Courier or Dovecot: the `doveadm` steps below apply only where it is set to **Dovecot**.
- You have shell (SSH) access as `root` to both servers, ideally with SSH key authentication configured between the two so `rsync` and `ssh` run without interactive password prompts.
- Replace the example Linux usernames (for example `root`) and hostnames (for example `plesk`, `ispconfig.test.co.za`) with your own server-specific identifiers.
- Replace the example domain name `test.co.za` with your actual domain throughout every command and path.

## Section 1: Migrating Individual Users (One by One)

Here you migrate a single user at a time, which makes verification and troubleshooting easier. Use this approach for smaller moves, or run it once as a test before committing to a bulk migration.

1. **Stop the mail services.** Freezing both ends prevents new mail arriving mid-copy and prevents index corruption.
    - On the source (Plesk) server, stop the mail server and the IMAP server. Plesk ships Postfix and qmail and uses Dovecot for IMAP by default, so this is usually `systemctl stop postfix dovecot` (use `qmail` in place of `postfix` if the server was switched to it). See [Using Other Mail Server Software](https://docs.plesk.com/en-US/obsidian/administrator-guide/mail/using-other-mail-server-software.72350/) in the Plesk documentation.
    - On the destination (ISPConfig) server: `systemctl stop dovecot`
2. **Copy the Maildir with rsync.** Run this from either end, whichever has the cleaner network path. The `--chown=vmail:vmail` flag maps ownership to the Dovecot mail user on arrival.
    - **Push from the source (Plesk) shell:** `rsync -avz --chown=vmail:vmail --exclude '@attachments' /var/qmail/mailnames/test.co.za/test/ root@ispconfig.test.co.za:/var/vmail/test.co.za/test/` Replace `root@ispconfig.test.co.za` with the actual destination login and hostname or IP.
    - **Pull from the destination (ISPConfig) shell:** `rsync -avz --chown=vmail:vmail --exclude '@attachments' root@plesk:/var/qmail/mailnames/test.co.za/test/ /var/vmail/test.co.za/test/` Replace `plesk` with the source hostname or IP. Connect as `root`: the mailbox directories under `/var/qmail/mailnames` belong to the mail system user and are not readable by an ordinary login.
3. **Start the mail service.** On the destination (ISPConfig) server: `systemctl start dovecot`. Dovecot now sees the freshly copied Maildir.
4. **Reindex the mailbox.** Rebuild the Dovecot indices so the transferred messages are searchable and consistent: `doveadm -v index -u test@test.co.za '*'` This aligns the indices with the copied data and clears most access glitches that appear immediately after a transfer.
5. **Verify.**
    - **Watch the log:** `tail -f /var/log/mail.log`
    - **Test IMAP login** for `test@test.co.za` with a mail client or webmail and confirm the folders and message counts match the source.
    - **Fix ownership and permissions** only if you see permission-denied errors. These give the `vmail` user full access to the Maildir tree:

      ```bash
      chown -R vmail:vmail /var/vmail/test.co.za/test/Maildir
      chmod -R u+rwx /var/vmail/test.co.za/test/Maildir
      ```

### Downtime Tip: Pre-sync, Then Final Sync

To keep mailboxes reachable for as long as possible, run the `rsync` in step 2 once **while both services are still running**. That first pass copies the bulk of the data. Then stop the services and run the identical `rsync` again: because rsync only transfers what has changed, the second pass is fast, so the actual downtime window shrinks to seconds or minutes rather than the full copy time.

### Notes on Special Maildir Files

- **Excluding `@attachments`:** Plesk keeps an `@attachments` folder beside each mailbox's `Maildir`. It is a Plesk folder, not part of the mail store: in Maildir format each attachment is stored inside its message file, and Dovecot saves attachments to a separate directory only for the dbox formats (see [`mail_attachment_dir`](https://doc.dovecot.org/2.3/settings/core/#core_setting-mail_attachment_dir) in the Dovecot documentation). ISPConfig does not use it, so `--exclude '@attachments'` keeps the migration focused on the mail itself.
- **`maildirfolder` and `maildirsize`:** `maildirfolder` is a Dovecot marker file used for folder organisation and access; `maildirsize` records the mailbox quota usage. Both may travel across with the data, and Dovecot will regenerate or adjust them during reindexing to match the destination. There is no need to delete them. If quotas look wrong afterwards, check with `doveadm quota get -u test@test.co.za` and correct the quota value in ISPConfig if needed.

### Repeat for Other Users

Apply the same steps to each additional user by changing the paths (replace `test` with the next username under `/var/qmail/mailnames/test.co.za/`) and updating the email address in the `doveadm` command.

## Section 2: Migrating All Users in Bulk

This section migrates every mailbox under `/var/qmail/mailnames/` on the source server in one pass. It assumes every email domain and mailbox already exists in ISPConfig (created in the panel or through the remote API), so the destination directories and authentication records are ready before any data moves.

**Account existence is mandatory.** Without a pre-existing ISPConfig account, rsync writes into a directory the mail system cannot authenticate against, because there is no matching row in the `mail_user` table. To prepare:

- Recreate every email domain and mailbox in the ISPConfig panel under **Email > Email Accounts > Domain** and **Email > Email Accounts > Email Mailbox**, replicating the source settings (quotas, aliases, and so on). The **Quota** field on the mailbox form is in MB.
- For large lists, use the ISPConfig remote API from a script (for example PHP calling `mail_user_add`) to add users in bulk. Create the API login first under **System > User Management > Remote Users**, and tick every call the script makes in the **Functions** list, for example `mail_domain_add` and `mail_user_add`. Calls to functions that are not ticked are refused.

1. **Stop the mail services.**
    - On the source (Plesk) server: stop the mail server and the IMAP server, as in Section 1.
    - On the destination (ISPConfig) server: `systemctl stop dovecot`
2. **Bulk rsync (run from the destination shell).** Loop over every user directory for the domain. Replace `plesk` with the source hostname or IP, and nest a second loop over domains if you are migrating more than one:

    ```bash
    for user in $(ssh root@plesk "ls /var/qmail/mailnames/test.co.za/"); do
      rsync -avz --chown=vmail:vmail --exclude '@attachments' root@plesk:/var/qmail/mailnames/test.co.za/$user/ /var/vmail/test.co.za/$user/
    done
    ```

3. **Bulk fix ownership and permissions.**

    ```bash
    for user in $(ls /var/vmail/test.co.za/); do
      chown -R vmail:vmail /var/vmail/test.co.za/$user/Maildir
      chmod -R u+rwx /var/vmail/test.co.za/$user/Maildir
    done
    ```

4. **Start the mail service.** On the destination (ISPConfig) server: `systemctl start dovecot`. The reindex in the next step uses doveadm, which looks each user up through Dovecot's auth service, so start Dovecot first.
5. **Bulk reindex (assumes usernames match directory names).**

    ```bash
    for user in $(ls /var/vmail/test.co.za/); do
      doveadm -v index -u $user@test.co.za '*'
    done
    ```

6. **Verify.** Watch `/var/log/mail.log` with `tail -f`, and test IMAP login for a sample of migrated accounts. See the notes in Section 1 for the behaviour of `@attachments`, `maildirfolder`, and `maildirsize`.

## Troubleshooting

- **Login fails after migration**: the mailbox was not created in ISPConfig before the copy. Create it in the panel (or via the API), then rerun the rsync and reindex for that user.
- **Permission denied reading mail**: ownership was not mapped to `vmail`. Rerun the `chown -R vmail:vmail` and `chmod -R u+rwx` commands against that mailbox's `Maildir`.
- **Messages or folders missing in the client**: the indices are stale. Rerun `doveadm -v index -u user@test.co.za '*'`, then reconnect the client.
- **Quota reported incorrectly**: check the live figure with `doveadm quota get -u user@test.co.za`, compare it against the panel report under **Email > Statistics > Mailbox quota** (that report is produced only for Dovecot, not for Courier), and correct the **Quota** value on the mailbox under **Email > Email Accounts > Email Mailbox**.

Migrations of this kind sit on Noiz managed platforms and are ordinarily carried out by the Noiz team as part of a move onto Noiz hosting. If you are moving mail onto Noiz and would like the migration handled or checked over, open a ticket from your Noiz client area and support will assist.

---
Source: https://docs.noiz.ie/ispconfig/how-to-migrate-maildir-emails-from-a-plesk-server-to-an-ispconfig-server/
