KNOWNHOST WIKI

User Tools

Site Tools


control-panels:cpanel-whm:how-can-i-migrate-a-cpanel-addon-domain-to-its-own-account

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
control-panels:cpanel-whm:how-can-i-migrate-a-cpanel-addon-domain-to-its-own-account [2019/10/10 14:59]
Karson N.
control-panels:cpanel-whm:how-can-i-migrate-a-cpanel-addon-domain-to-its-own-account [2020/06/02 11:08] (current)
Karson N. [Extracting the created backup]
Line 7: Line 7:
 </WRAP> </WRAP>
  
 +\\
 ===== Copying an Addon Domain to a New cPanel Account ===== ===== Copying an Addon Domain to a New cPanel Account =====
 You'll need to login to your WHM Panel as the root user. ( https://yourserversip:2087 or http://yourserversip:2086 ) You'll need to login to your WHM Panel as the root user. ( https://yourserversip:2087 or http://yourserversip:2086 )
  
 +\\
 ==== Create a backup of the account containing the addon domain ==== ==== Create a backup of the account containing the addon domain ====
     - Navigate to WHM's List Accounts Panel ( //Home » Account Information » List Accounts// )     - Navigate to WHM's List Accounts Panel ( //Home » Account Information » List Accounts// )
Line 16: Line 18:
     - Via the Backup Page, click the "Download" button under the "Full Backup" section.     - Via the Backup Page, click the "Download" button under the "Full Backup" section.
     - You will then be prompted to pick a backup destination and opt to be notified once the backup is complete. For the destination, ensure that you select "Home Directory".     - You will then be prompted to pick a backup destination and opt to be notified once the backup is complete. For the destination, ensure that you select "Home Directory".
 +
 +\\
 ==== Create a new cPanel account ==== ==== Create a new cPanel account ====
     - Close out of the cPanel user's interface and navigate back to WHM.     - Close out of the cPanel user's interface and navigate back to WHM.
Line 21: Line 25:
     - When creating the new account, which will be used as the migrated destination for your current addon domain, you must not use the addon domain's domainname for this new account. I'd recommend something like 'domainname-newcopy.com'     - When creating the new account, which will be used as the migrated destination for your current addon domain, you must not use the addon domain's domainname for this new account. I'd recommend something like 'domainname-newcopy.com'
       * The remain configuration settings and options are strictly up to you.       * The remain configuration settings and options are strictly up to you.
 +
 +\\
 ==== Extracting the created backup ==== ==== Extracting the created backup ====
-    SSH into your server as the root user. +    SSH into your server as the root user. 
-      * ''ssh root@serversipaddress -p 2200'' +<code> 
-    Make a new backup directory for the old addon domain account. +  ssh root@serversipaddress -p 2200 
-      * ''mkdir /home/backup-oldaccountusername'' +</code> 
-    Move the newly created backup file ( ''/home/oldaccountusername/backup-10.24.2014_15-59-39_oldaccountusername.tar.gz'' ) into that newly created backup directory. + 
-      * ''mv /home/oldaccountusername/backup-10.24.2014_15-59-39_oldaccountusername.tar.gz /home/backup-oldaccountusername/'' +    Make a new backup directory for the old addon domain account. 
-    Extract the backup file inside of that directory. + 
-      * ''cd /home/backup-oldaccountusername'' +<code> 
-      * ''tar -xzf backup-10.24.2014_15-59-39_oldaccountusername.tar.gz'' +  mkdir /home/backup-oldaccountusername 
-    Copy the addon domain contents to the newly create cPanel account's html directory. +</code> 
-      * ''cd /home/backup-oldaccountusername/backup-<date>_<digits>_<oldaccountusername>/homedir/public_html/''+ 
 +    Move the newly created backup file ( ''/home/oldaccountusername/backup-10.24.2014_15-59-39_oldaccountusername.tar.gz'' ) into that newly created backup directory. 
 + 
 +<code> 
 +  mv /home/oldaccountusername/backup-10.24.2014_15-59-39_oldaccountusername.tar.gz /home/backup-oldaccountusername/ 
 +</code> 
 + 
 +    Extract the backup file inside of that directory. 
 +<code> 
 +  cd /home/backup-oldaccountusername 
 +  tar -xzf backup-10.24.2014_15-59-39_oldaccountusername.tar.gz 
 +</code> 
 + 
 +    Copy the addon domain contents to the newly create cPanel account's html directory. 
 +<code> 
 +  cd /home/backup-oldaccountusername/backup-<date>_<digits>_<oldaccountusername>/homedir/public_html/ 
 +</code> 
       * Determine the folder/directory that the addon domain resides in, for this example we'll say '//addondirectory//'.       * Determine the folder/directory that the addon domain resides in, for this example we'll say '//addondirectory//'.
-      * ''cp -R addondirectory/* /home/newcpanelaccount/public_html''+ 
 +<code> 
 +  cp -R addondirectory/* /home/newcpanelaccount/public_html 
 +</code> 
 + 
 +\\
 ==== Import the old databases to the new account ==== ==== Import the old databases to the new account ====
     - Recreate the addon domain's databases and create the database users in cPanel's MySQL Databases interface ( Home >> Databases >> MySQL Databases ).     - Recreate the addon domain's databases and create the database users in cPanel's MySQL Databases interface ( Home >> Databases >> MySQL Databases ).
       * Prepend newcpanelaccount to the databases when you create them.  ( ex. //newcpanelaccount_databasename// ).       * Prepend newcpanelaccount to the databases when you create them.  ( ex. //newcpanelaccount_databasename// ).
     - After you create the databases and database users, import each domain's database backups. To do this, run the following command for each backup:     - After you create the databases and database users, import each domain's database backups. To do this, run the following command for each backup:
-      - ''mysql newcpanelaccount_databasename < /home/backup-oldaccountusername/backup-<date>_<digits>_<oldaccountusername>/mysqloldaccountusername_dbname.sql''+<code> 
 +  mysql newcpanelaccount_databasename < /home/backup-oldaccountusername/backup-<date>_<digits>_<oldaccountusername>/mysqloldaccountusername_dbname.sql 
 +</code> 
 + 
 +\\
 ==== Fix the ownership and permissions ( based on suPHP ) ==== ==== Fix the ownership and permissions ( based on suPHP ) ====
     - Correct all file and directory permssions.     - Correct all file and directory permssions.
-      * ''find /home/newcpanelaccount/public_html/ -type d -print0 | xargs -0 chmod 0755''  +<code> 
-      * ''find /home/newcpanelaccount/public_html/ -type f -not -name "*.pl" -not -name "*.cgi" -not -name "*.sh" -print0 | xargs -0 chmod 0644''  +  find /home/newcpanelaccount/public_html/ -type d -print0 | xargs -0 chmod 0755 
-      * ''find /home/newcpanelaccount/public_html/ -type f -name "*.cgi" -print0 -o -name "*.pl" -print0 -o -name "*.sh" -print0 | xargs -0 chmod 0755''+  find /home/newcpanelaccount/public_html/ -type f -not -name "*.pl" -not -name "*.cgi" -not -name "*.sh" -print0 | xargs -0 chmod 0644 
 +  find /home/newcpanelaccount/public_html/ -type f -name "*.cgi" -print0 -o -name "*.pl" -print0 -o -name "*.sh" -print0 | xargs -0 chmod 0755 
 +</code> 
     - Correct all file and directory ownership.     - Correct all file and directory ownership.
-      * ''find /home/newcpanelaccount/public_html/ -type f | xargs chown newcpanelaccount:newcpanelaccount'' + 
-      * ''find /home/newcpanelaccount/public_html/ -type d | xargs chown newcpanelaccount:newcpanelaccount''+<code> 
 +  find /home/newcpanelaccount/public_html/ -type f | xargs chown newcpanelaccount:newcpanelaccount 
 +  find /home/newcpanelaccount/public_html/ -type d | xargs chown newcpanelaccount:newcpanelaccount 
 +</code> 
 + 
 +\\
 ==== Confirm that the newly created account works properly ==== ==== Confirm that the newly created account works properly ====
     - You can test this with instructions from the How can I test my migrated website before changing the DNS? article in or Knowledgebase.     - You can test this with instructions from the How can I test my migrated website before changing the DNS? article in or Knowledgebase.
 +
 +\\
 ==== Remove the addon domain (it's ok, you have a backup if anything goes wrong) ==== ==== Remove the addon domain (it's ok, you have a backup if anything goes wrong) ====
     - Once you've confirmed that the new account works properly remove the old account's addon domain from the cPanel user's interface.     - Once you've confirmed that the new account works properly remove the old account's addon domain from the cPanel user's interface.
     - Once logged in to the old account's cPanel interface ( [[:control-panels:cpanel-whm:how-can-i-migrate-a-cpanel-addon-domain-to-its-own-account#create_a_backup_of_the_account_containing_the_addon_domain|reference]] ) navigate to the Addon Domains Panel. ( Home >> Domains >> Addon Domains ).     - Once logged in to the old account's cPanel interface ( [[:control-panels:cpanel-whm:how-can-i-migrate-a-cpanel-addon-domain-to-its-own-account#create_a_backup_of_the_account_containing_the_addon_domain|reference]] ) navigate to the Addon Domains Panel. ( Home >> Domains >> Addon Domains ).
     - Scroll down to Modify Addon Domain and select the Delete Action.     - Scroll down to Modify Addon Domain and select the Delete Action.
 +
 +\\
 ==== Change the new account's domain name ==== ==== Change the new account's domain name ====
     - Navigate to WHM's Modify an Account Panel ( //Home >> Accounts >> Modify an Account// ) and change the 'temporary' new account domain ( ex. //domainname-newcopy.com// ) to the addon domain's domain name that is now removed.     - Navigate to WHM's Modify an Account Panel ( //Home >> Accounts >> Modify an Account// ) and change the 'temporary' new account domain ( ex. //domainname-newcopy.com// ) to the addon domain's domain name that is now removed.
  
 +\\
 ===== Other Useful Resources ===== ===== Other Useful Resources =====
  
-  * cPanel's Official [[https://documentation.cpanel.net/display/CKB/How+to+Copy+Addon+Domains+to+a+New+Account|Copy Addon Domain]] Documentation+  * cPanel's Official ((https://documentation.cpanel.net/display/CKB/How+to+Copy+Addon+Domains+to+a+New+Account))[[https://documentation.cpanel.net/display/CKB/How+to+Copy+Addon+Domains+to+a+New+Account|Copy Addon Domain]] Documentation
control-panels/cpanel-whm/how-can-i-migrate-a-cpanel-addon-domain-to-its-own-account.1570737562.txt.gz · Last modified: 2019/10/10 14:59 by Karson N.