How to switch between 2 website versions easily

monotest

Registered
Sep 6, 2007
4
1
53
Hi,

I have two website versions (old and new). Old is located under userOld, new under userNew.

How do I point domain.com back and forth between different accounts easily?

It would be pretty easy if both projects would be under the same account, I would have only to change web root path (www/old or www/new) but due to the security issues (Wordpress could be hacked someday...) I would like to keep websites under different accounts.

Thanks
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,418
999
313
cPanel Access Level
Root Administrator
Hey there! If you are just doing this for testing, and one of the domains had a dedicated IP address, you could use your local hosts file to re-route your local DNS to the secondary site while you perform your testing. Details on how to do that can be found here:

 

monotest

Registered
Sep 6, 2007
4
1
53
Thanks for the reply, but local DNS won't work for me. I'm looking for a more permanent solution. I'm looking to launch a new website version and in case it faces some unexcepted issues, I would like to revert back to an old website version promptly.

The second easiest solution would be to host my new website version elsewhere and change nameservers if required but I don't want to migrate from my current powerful server elsewhere just for this.

My old website is set as an addon domain and points to a specific web root. I tried creating a new account for the some domain but I've got the error message:
"The domain “domain.com” already exists in the userdata"

It makes sense because that domain exists on the system.

I guess it's not possible to achieve what I want easily on the same server (and by keeping both websites under different accounts for security purposes)?
 

keat63

Well-Known Member
Nov 20, 2014
1,916
263
113
cPanel Access Level
Root Administrator
Hi.
Whats your level of access.
Do you have root access to WHM or just Cpanel ??

If you have WHM access, then would changing the primary domain name asscociated with that user work. (Inside Modify Account)
 

monotest

Registered
Sep 6, 2007
4
1
53
Yes, I have root access to WHM.

I will try your suggestion, thanks.

I will remove the add-on domain first and create a new user. When I want to revert back, I would modify the new account to some other domain (or just subdomain) and add the add-on domain back. I think there is no faster way than this.
 
  • Like
Reactions: cPRex