These are the steps I followed to migrate my emails from cPanel to mailcow:

  1. Create & run a Gist Icon shell script
    Gist Icon Gist
    get all emails and their password hashes from a cPanel server
    get all emails and their password hashes from a cPanel server - get_cpanel_emails.sh
    get all emails and their password hashes from a cPanel server - get_cpanel_emails.sh
    to get all email accounts and their hashed passwords on the cPanel server
  2. Copy the values over to a spreadsheet and format it as follows (without the headers):
emailnamepasswordquotadomain_plan
user@domain.comJohn Doe$6$gXTAxV55yCGJ09C/$9cMquoWx43H0fChCpEoM4dZ4md.c4qlxGkmd91EJK9Kn.V/gSknM7IzDRKcslYBLHknB4.HG/w1Qn/XUyFQJC/1024default
  1. Export it as comma separated csv and use GitHub Icon mailcowtools
    GitHub Icon GitHub
    mailcowtools/addMailboxes/addMailboxes.js at master · rallisf1/mailcowtools
    Simple tools that use the mailcow API. Contribute to rallisf1/mailcowtools development by creating an account on GitHub.
    Simple tools that use the mailcow API. Contribute to rallisf1/mailcowtools development by creating an account on GitHub.
    to import it via the API. Note that I have updated it to autocreate the domains and support domain plans (manually because mc API doesn’t provide a templates endpoint).
  2. Use imap sync if you know the passwords or rsync/scp to copy the email data over from cpanel to mailcow. I used scp.

If you use scp/rsync like I did you need 2 more steps:

  1. Run the encrypt commands from the docs.mailcow.email Icon documentation
    docs.mailcow.email Icon docs.mailcow.email
    Mail crypt - mailcow: dockerized documentation
    None
    docs.mailcow.email
  2. run docker compose exec dovecot-mailcow doveadm quota recalc -A

mailcow/mailcow-dockerized516

No one is typing

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!