Switching the main domain for an account in WHM

oruen

Registered
Aug 2, 2011
2
0
51
Hi all,

I am trying to switch the main domain for my client to another domain. For the purpose of testing, I created an account with a main domain sdomain.mydomain.com and addon domain sdomain1.mydomain.com. I removed the sdomain1.mydomain.com and went to WHM. I replaced the sdomain.mydomain.com with the subdomain that was removed. Then I added the replaced subdomain as an addon domain. Everything went fine.

But... It didn't when I tried to do the same on my client's account. He wanted to switch the main domain with another domain (hisdomain.com to anotherdomain.com). So I removed the addon domain anotherdomain.com (which was the target main domain for the account) and went to WHM. Switching the domains went quite smoothly, no problems occured. But when I tried to add the domain that was the main domain, an error occured. there is a message about editing the httpd.conf file and I have no clue where to find this file and how to edit it. Moreover, to my surprise, the domain that was the main domain for this account appeared as an addon domain in "addon domains" section, but the e-mail accounts related to that domain are no longer on the list in the "email accounts" section. When I try to remove the domain, a message saying that I am not the owner of this domain appears.

What should I do?

More info:
- I have shell access
- I have access to the root account (but I use the reseller account)

Thanks in advance for your help
Oruen
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
I have one question. If the old main domain is supposed to be an addon domain and it is showing up now as an addon domain, why does that domain need to be removed and re-added as an addon domain? Is the domain not working or pointing to the wrong folder location?
 

oruen

Registered
Aug 2, 2011
2
0
51
There was a lot of e-mail accounts defined for that domain that don't show up in the email accounts section. I have read a tutorial that says that if I remove the domain and then re-attach it, the email accounts will be there again.

Thanks for your help
Oruen
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
The following thread explains what to check to remove the subdomain that likely exists for that addon domain:

http://forums.cpanel.net/f5/error-d...ot-exist-user-solution-221782.html#post915312

You can replace sub with the addon domain name in most instances to see if it exists in any of the files. The main differences would be these greps:

Code:
grep addon.com /var/cpanel/users/*
grep addon.com /etc/*
grep -R addon.com /var/cpanel/userdata/*
ls -lah /var/named/addon.com.db