Sometimes people like to make one cPanel account with multiple domains within it. With cPanel, this can make things difficult sometimes. There are a few things that would require your domain to be on its own cPanel account. Like in order for a domain to have its own IP it needs its own cPanel account. Also in order to have an SSL you will need a dedicated IP address.
Moving your add on domain to its own cPanel account is fairly simple. It’s just a matter of taking some backups, removing the domain, creating the new account, and then restoring the files and the database. You can do this all via cPanel in WHM, or if you know command line there will be some command line tricks to help move multiple accounts.
Moving things via cPanel:
Backup Your files
- First you need to go into you cPanel’s file manager.
- Then you need to find the domains document root in the public_html folder.
- Open the folder and hit “select all” at the top. Pay attention to the very first file in the list. This will be the name of your .zip file.
- In the top right corner of the file manager is the compress button. Compress it as a zip file. Once it is compressed you will have a .zip file to download to your local machine.
- Highlight the zip file and download it to your local machine.
Backup your database
- Find the backup wizard
- Choose databases on the right side
- Choose the database for the corresponding domain and save it to your desk top you will need it shortly.
Delete the add-on domain and create the new domain.
- In your cPanel, go to add-on domains. Find the domain, in the list and delete it. If the add on domain has sub-domains you will need to back out and go delete the sub-domains for the site in the same way, before you can delete the add-on.
- Now you will need to go into WHM. Go to Create account and fill out the information accordingly with the domain we just backed up and deleted.
Restoring the files
- Go into the file manager for the new account.
- Upload the .zip file into the public_html folder.
- Highlight the zip file and hit “extract?, net to compress.
Restore the database
- Go back to the backup wizard but this time choose restore.
- Choose to restore databases.
- Find the .sql file and restore it.
You may need to change some database configurations within your site. But now you should have a full working site on its own cPanel account. You may find some issues depending on the software used to manage the site. Like with word press it can mess up the perma links. This can usually be fixed by resetting the perma links by changing them to default and then back to the style you had.
Use these command line tricks to move multiple domains.
mysqldump data_base > data_base.sql
- Dump all databases from the user: <USER>
for each in `mysql -e ‘SHOW DATABASES;’|grep <USER>`;do mysqldump $each > $each.sql;echo backup complete: $each;done
mysql new_database < old_database.sql
- Backup the files for multiple add-on domains. First you will need to make a text file called temp.txt inside the public_html folder of the add-ons your backing up, You will make a list of all the domains needing to be copied to /home/tempdomains
for each in `cat temp.txt`;do rsync -avHl $each /home/tempdomains;echo done;
- To restore all of the files run the following command for each domain
rsync -avHl /home/tempdomains/domain.tld/* /home/<new user>/public_html
You still have to do the deleting and creating of accounts and databases from within cPanel, but this can be faster for moving multiple domains.