-1

I have two domains hosted on GoDaddy cpanel - one is the primary and the other is an Addon. Each of the two domains has a live website hosted on it (both sites developed on Wordpress). Basically I just need to swap the Addon domain to become the primary domain. What's the best way of doing this? I have researched and there are different approaches I gathered.

1- First approach is, to swap the primary domain website files (on File Manager) to be in a sub-folder under public_html. While the Addon domain website files to be placed directly under the root of the Public_HTML folder. Also to go into the Addon Domains option in cpanel, and do something about adding the "connect" to the Addon. I didn't understand what this meant. I can see my Addon domain is in the Addon Domains list. But not sure what else I need to do there?

2- Or I saw another way is, to create subfolders for each website and specify in the .htaccess (in the public_html) the folder which you want to be the main domain (after copying some template script of .htaccess and modyfying the main domain part of the script to be your domain). Then login to the Wordpress admin and in Setting ensure the wordpress address (url) and site address (url) are pointing to the correct sub folder under the domain hosted. Apparently the purpose of this approach is not to place an entire website folders and files directly under the root of public_html, which is very messy. But to keep each website organised in its own sub folder.

So which approach is more recommended? I.e. which is the least messy?

My last question is, I already have the main domain website folders and files directly under the root of the public_html. I don't know which folders and files belong to the website, that I need to move to a subfolder. Under the public_html, I have the following folders (exclusing subfolder of other websites, which obviously belongs to the other websites). I don't which of these folder are part of the main website (to move into a sub folder) and which folders are meant to stay under the public_html:

  • .htpasswds
  • .well-known
  • cgi-bin
  • hilositelock
  • oldwp-content
  • replica
  • test
  • wp-admin
  • wp-content
  • wp-includes
  • wpps-tools

Please refer to the info below about the hosting info (in case it's required):

  • Hosting Package: Ultimate
  • cPanel Version: 78.0 (build 27)
  • Apache Version: 2.4.39
  • PHP Version: 5.6.40
  • Operating System: linux

Many thanks

Hazzaldo
  • 335
  • 3
  • 16

1 Answers1

0

Here is the solution to your question.

If you want to swap both site's data (add-on and primary domain) then first take the backup(files and databases) of both websites using some plugin (As you are using WordPress).

Then set add-on domain as primary domain.

Now primary domain will become parked domain and add this parked domain as add-on domain and install a fresh WordPress on it.

Now you can simply restore backup of both sites using the plugin you had used for backup.

For Reference you can relate to this video.