How to migrate mails from cPanel to myVesta

Post Reply
User avatar
T4B
Posts: 124
Joined: Sat Jul 11, 2020 9:44 am

hello how can move cpanel mails to vestacp webmail ?

Tags:
User avatar
myVesta
Site Admin
Posts: 756
Joined: Fri Jun 19, 2020 9:59 am

You can import the whole cpanel backup - viewtopic.php?f=24&t=63

But there is another solution.
cPanel is using the same maildir format for emails, so you can even create empty email accounts in myVesta (this is mandatory), and then simply copy those mail files from cPanel to myVesta server (destination folder will be: /home/user/mail/domain.com/emailusername/ )
After that, just delete dovecot caching files:

In your SSH, as root, run:

For specific email accounts:

Code: Select all

sudo find /home/user/mail/domain.com/emailusername/ -type f -name 'dovecot*' -delete
For the whole domain:

Code: Select all

sudo find /home/user/mail/domain.com/ -type f -name 'dovecot*' -delete
Then restart dovecot:

Code: Select all

sudo systemctl restart dovecot
And, at the end you have to fix the permissions:

Code: Select all

find /home/user/mail/ -type d -exec chown user:mail {} \;
find /home/user/mail/*/ -type d -exec chown user:mail {} \;
find /home/user/mail/*/ -type f -exec chown user:mail {} \;
Instead of the user, insert the username of the account on which emails are located.
User avatar
T4B
Posts: 124
Joined: Sat Jul 11, 2020 9:44 am

Code: Select all

sudo find /home/user/mail/domaim.com/emailusername/ -type f -name 'dovecot*' -delete
sudo systemctl restart dovecot
this commands for myvestacp ?
User avatar
myVesta
Site Admin
Posts: 756
Joined: Fri Jun 19, 2020 9:59 am

Yes
Post Reply