BuycPanel Blog

BuycPanel Blog

Latest news and updates

Copying Add-on Domains to Your New Accounts (part 2)

Posted by Allison on 03 01 2017.

The part 1 of this 2-part series of copying add-on domains to new cPanel accounts involved outlining and discussing of the first four steps, which included creating backups, creating new accounts, extracting the backups, and importing the databases.

 

In this second and final part of the series, it will contain the remaining 6 steps, including updating the cron paths all the way to copying all your email account information. Just follow the remaining steps and you will have your add-on domains copied to your new accounts in no time.

 

Step 5. Updating your cron paths.

 

Follow these steps to update your new account’s cron paths:

 

 	Locate and open your /home/backup-$username/$username/cron/$username file. Make sure that you find all of the required crons in this add-on domain.
 	Navigate to your cPanel account’s Cron Jobs interface and then add all of the crons to your new account. You can find the Cron Jobs interface by starting…

The part 1 of this 2-part series of copying add-on domains to new cPanel accounts involved outlining and discussing of the first four steps, which included creating backups, creating new accounts, extracting the backups, and importing the databases.

 

In this second and final part of the series, it will contain the remaining 6 steps, including updating the cron paths all the way to copying all your email account information. Just follow the remaining steps and you will have your add-on domains copied to your new accounts in no time.

 

Step 5. Updating your cron paths.

 

Follow these steps to update your new account’s cron paths:

 

  • Locate and open your /home/backup-$username/$username/cron/$username file. Make sure that you find all of the required crons in this add-on domain.
  • Navigate to your cPanel account’s Cron Jobs interface and then add all of the crons to your new account. You can find the Cron Jobs interface by starting at your Home page, then Advanced, and finally, Cron Jobs.

 

Step 6. Change the ownership of the file.

 

Executing the chown command will provide ownership to your $newuser for all the public_html files you just made copies of. Just run the command: “find /home/$newusername/public_html -uid 0 -exec chown $newusername:$newusername {} +” (remove the quotation marks) to perform this step.

 

Step 7: Make sure the account operates perfectly.

 

A single mistake, like a typo in any of the commands required for this task may result in a malfunctioning account.

 

Thus, once you have changed the ownership of the files, have your OS’ hosts file pointed towards the placeholder’s temporary domain.

 

Step 8: Eliminate your add-on domain.

 

After establishing that all of the aspects and elements of your new cPanel account operates perfectly, you can now get rid of the add-on domain’s old account. You can do this via the Addon Domains interface in your cPanel account. Just go to Home, then Domains, and finally, Addon Domains.

 

Step 9. Revise the placeholder domain’s name.

 

After eliminating the add on domain of the old account, head to the Modify an Account interface found in your WHM account. Replace the main domain name of the new account with the new add-on domain name.

 

Step 10: Start copying email account info.

 

After replacing the domain name, you can now begin copying the info of your old account. These include emails, auto responders, forwarders, and filters.

 

To perform this task, run these commands right after you open the /home/backup-$username/$username directory:

 

  • 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/

 

Once you have finished copying the data, you need to change the ownership of the files once again and hand them over to the new user. Just run these commands to complete this part:

 

  • 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 {} +

 

As final reminders, you need to ensure that you keep the wildcards through passing the asterisks on any side of the $addonname. Also, once you have changed file ownership, establish that you can still log in to the Webmail account.