Change domain primary, but email don't changed

sysber

Registered
Nov 27, 2006
2
0
151
Hi all,

Had two domains on the server

x.com (example)
y.com (example)

The x.com was the primary and had some email accounts created.

But the client requested that the y.com become the main.

What I did: removed the y.com it was like ... I was in secondary whm and changed the x.com to y.com. And added the secondary x.com (it was primary before)

But the email accounts that had, are still created as x.com and were not changed for y.com.

Know how I can fix this?

Regards & Thanks
 

PlatinumServerM

Well-Known Member
PartnerNOC
Jul 10, 2005
400
3
168
New Jersey, USA
cPanel Access Level
Root Administrator
You can recreate the mail accounts on the new name after you change the domain and then move the contents of the mailboxes over, they are in /home/username/mail/
 

sysber

Registered
Nov 27, 2006
2
0
151
The problem is to inform all users of the new password. That would be a very big impact, because the client has 80 email accounts.

I found a solution by some local tests:

I made a copy of the passwd file that is in the area that is now as secondary domain (home/xxxx/etc/x.com/ passwd)

Changing only the destination directory that x.com file for y.com

After copied the shadow file to the folder:

/home/xxxx/etc/y.com/

And did the copy of the mail directory:

cp -r -p /home/xxxxx/mail/x.com/account1 /home/xxxxx/mail/y.com/

Thus, it was possible to receive emails on new address (y.com) keeping the same password.

I am testing in two e-mail initially and tests, everything is working fine.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello,

I am happy to see you were able to find a workaround to the issue. Thank you for updating us with the outcome.