An entirely new account can be created from an addon domain. For this purpose, the addon domain’s information needs to be copied and added to the newly-created account.
2. Table of Contents
2
Introduction
Example Values
Create a Backup File
Create a New Account
Extract the Backup File
Extract the Backup File
(Continued)
Import the Databases
Update Cron Job Paths
Change File Ownership
Confirm the Functioning of
the Account
Remove the Addon Domain
Change the Placeholder
Domain’s Name
Copy Over Email Account
Information
Change the Ownership of
Files
Log in Confirmation
3. Once you have created an addon domain, an entirely new account can be created from that addon
domain. For this purpose, the information from the addon domain needs to be copied and added to a
newly-created account.
The following slides will run you through the steps involved in copying addon domains to a new
account.The information that has been provided here is valid for only version 54 and the earlier
versions of cPanel & WHM.The Convert Addon Domain to Account interface of WHM needs to be
used for cPanel & WHM version 56 and later.
WHM >> Home >>Transfers >> Convert Addon Domain to Account
It needs to be mentioned here that only the root user or those resellers, who have root-level
privileges, will be able to carry out this action, as it requires moving files.
3
Introduction
4. The below-mentioned example values are used in the information contained in the following slides.
username – It represents the account’s user.
newusername – It represents the new account’s user.
addonname – It represents the addon domain’s name.
addondirectory – It represents the addon domain’s directory.
To digress, the facility to register and transfer domains is provided by many web hosting companies,
such as HTS Hosting. HTS Hosting has been consistently referred to as the “Best Web Hosting
Company”, the “Best Cloud Hosting Company”, etc. due to the high quality of service offered by it at
affordable prices.
4
ExampleValues
5. Carry out full backup of the account which contains the addon domain. Use the Backups interface of
cPanel (cPanel >> Home >> Files >> Backups) for this purpose, or run the following script:
/usr/local/cpanel/scripts/pkgacct
5
Create a Backup File
7. Create a new account that has a placeholder name in the Create a New Account interface in WHM.
WHM >> Home >> Account Functions >> Create a New Account
It needs to be mentioned here that you should not use the name of the addon domain as the new
account name.
7
Create a New Account
8. The below-mentioned steps need to be performed to extract the backup file.
1. Create the /home/backup-username directory by running the following commands:
mkdir /home/backup-username
mv cpmove-username.tar.gz /home/backup-username/
! Then move the backup file into it.
Navigate to the /home/backup-username directory by running the following commands:
tar -xzf cpmove-username.tar.gz
cp /home/backup-username
Then the backup needs to be uncompressed.
It needs to be mentioned here that the above-mentioned commands extract the contents of the backup file to either
the cpmove-username or username directories. 8
Extract the Backup File
9. Run the following command:
cp -R homedir/public_html/addondirectory/* /home/newusername/public_html/
This command adds the homedir/public_html/addondirectory/ subdirectory to the /home/backup-
username/public_html/ directory.
9
Extract the Backup File (Continued)
10. Carry out the following steps to import the databases:
Recreate the databases of the addon domain and create the database users in the MySQL Databases
interface in cPanel.
cPanel >> Home >> Databases >> MySQL Databases
Prepend newusername to the databases at the time when you create them. An example of this is when you
create the newusername_dbname file. In it, dbname represents the name of the database.
Import the database backups of each domain, after creating the databases and database users. For this
purpose, you need to run the below-mentioned command for each backup.
mysql newaccount_dbname < /home/backup-username/username/mysql/username_dbname.sql
10
Import the Databases
11. You need to carry out the following steps for updating the new account’s cron paths:
Open the /home/backup-username/username/cron/username file. Then check for the cron jobs of the
addon domain.
Add the paths for the cron jobs of the addon domain to the new account in the Cron Jobs interface in
cPanel.
cPanel >> Home >> Advanced >> Cron Jobs
You need to ensure that the paths of the cron jobs match the paths of the new account to the same cron
jobs files.
11
Update Cron Job Paths
12. The chown command needs to be used in order to grant ownership of the copied public_html files to
the newusername user.
find /home/newusername/public_html -uid 0 -exec chown newusername:newusername {} +
12
Change File Ownership
13. You must confirm that the account functions properly after any change in the ownership of the files.To
ensure this, you have to point the hosts file of your operating system to the temporary domain
placeholder.
13
Confirm the Functioning of the Account
14. Remove the addon domain of the old account in the Addon Domains interface in cPanel.
cPanel >> Home >> Domains >> Addon Domains
14
Remove the Addon Domain
15. Navigate to the Modify an Account interface in WHM.
WHM >> Home >> Accounts >> Modify an Account
Next, change the main domain name of the new account to the name of the addon domain.
15
Change the Placeholder Domain’s Name
16. Change the domain name.After that, copy the emails, forwarders, autoresponders, and filters of the old
account to the new account. For that purpose, you need to open the /home/backup-username/username
directory and then run the following commands:
cp va/addonname /etc/valiases/
cp vf/addonname /etc/vfilters/
cp homedir/.autorespond/*addonname* /home/newusername/.autorespond/
cp -R homedir/etc/addonname /home/newusername/etc/
cp -R homedir/mail/addonname /home/newusername/mail/
16
Copy Over Email Account Information
17. Once you have copied the emails, filters, forwarders and autoresponders, you need to change the
ownership of those files to the new user.You should run the following commands to attain that:
chown newusername:mail /etc/valiases/addonname
chown newusername:mail /etc/vfilters/addonname
chown newusername:newusername /home/newusername/.autorespond/*addonname*
find /home/newusername/etc -uid 0 -exec chown newusername:mail {} +
find /home/newusername/mail -uid 0 -exec chown newusername:mail {} +
You should append asterisks ( * ) on either side of addonname to ensure that it keeps the wildcards.
17
Change the Ownership of Files
18. You need to confirm that you can log in to the Webmail account of the user after you have changed
the files’ ownership.
Navigate to the /home/newusername/etc/addonname directory and find the users as well as the email
passwords for authentication to Webmail, IMAP, and POP3.
18
Log in Confirmation