How to Merge 2 or More cPanel Accounts
Unfortunately, there is no way to merge 2 or more cPanel accounts into one automatically. That is why the transfer should be done manually.
Before stating the transfer please reply to the questions below and follow the appropriate instructions according to the replies:
- What servers hosting accounts are located on: different servers or the same one?
- Do you host only 1 domain name in your account?
- Do source hosting accounts contain any databases, email accounts or they have only html based sites?
1. If you have 2 shared accounts that are located on the same server and contain only html based sites with no databases, email accounts, etc. and where only 1 domain is hosted you should do the following:
1.1. Full backup of the second account (source one) should be created and saved somewhere on your local pc.
1.2. When backup is created, ask Billing to cancel your source account, otherwise you would not be able to add domain name from the source account to the destination one.
1.3. Add main domain of the source account as an addon domain to destination account and upload your backup to the corresponding folder (folder created for addon domain).
1.4. After that restore your backup. That’s it.
2. If you have 2 shared accounts that are located on different servers and do not contain any databases or email accounts, etc. and where only 1 domain is hosted please do the following:
2.1. Nameservers of the main domain of the source account should be changed to dns1.dlitshosting.com and dns2.dlitshosting.com (please check Changing DNS tutorial if your domain name is registered with Drem Line IT Solution)
2.2. Main domain name of the source account should be added as addon one to the destination account (please check Managing Addons tutorial)
2.3. To move data without using local PC, ftp account called “[email protected]” in destination account should be created and pointed to /home/destination/transfer outside public_html folder. This ftp account will be used to accept cPanel backup of the source account.
2.4. Full cPanel backup of the source account should be created. Choose Backup Destination: ‘Remote FTP Server’ in drop-down list and fill in credentials of recently created “transfer” ftp account.
2.5. When backup transfer is complete, unpack it and copy files to the corresponding folder (folder created for addon domain).
2.6. Check if everything works fine and request source account cancellation. That’s it.
3. If you have more accounts with more domain names they have databases and email accounts in them the process will be a bit longer and more complicated.
Several “let it be” defines:
- Let’s consider that your main account which you are going to move your data to is called “destination” and your second account which the data will be moved from is called “source”
- “Source” account has default email account and 2 additional ones called “info” and “sales”, 1 database called “source_sourcedb” with “source_user1” user assigned to it.
Please do the following to merge your hosting accounts successfully:
3.1. If you are familiar with SHH request shell access to the target server by submitting a ticket to our Hosting Technical Support at helpdesk. SSH will help you greatly and will make the process faster.
3.2. Please acknowledge that different cPanel accounts have different usernames and as a result different paths in the system and different prefixes for MySQL databases.
3.3. Destination account should be upgraded to Pro. Please submit a ticket to our Billing with the upgrade request at helpdesk.
3.4. Namesevers of the main domain of the source account should be changed to dns1.dlitshosting.com and dns2.dlitshosting.com (please check Changing DNS tutorial if your domain name is registered with Dream Line IT Soltion)
3.5. Main domain name of the source account should be added as addon one to the destination account (please check Managing Addons tutorial). It would be better to create addon domain outside public_html directory to avoid applying of .htaccess permissions from primary domain to your addon one. Create public_second folder and change permissions for it to prevent other users from reading your common config files with mysql credentials, etc. After that allow user “nobody” browse public_second directory by placing group “nobody” to it. You can do this with a help of file manger or shell.
All additional domain names from your source account should be added as addon domains and parked to public_second folder in destination account. Please keep the same relative structure you have in your source account. It is better to keep structure hierarchy to save path related links.
3.6. When all domains from source account are added to destination one you should re-create email accounts of your source account there. You can use other passwords than you had previously, but the amount and name of email accounts should be identical. If you had any forwarders, etc. all of them should also be created.
3.7. Databases and users for them from the source account should be created in your destination account. Please keep in mind that both passwords and usernames should be identical in both destination and source accounts.
3.8. To move data without using local PC, ftp account called “[email protected]” in destination account should be created and pointed to /home/destination/transfer outside public_html folder. This ftp account will be used to accept cPanel backup of the source account.
3.9. Go to cPanel of the source account and make Full cPanel backup. Choose Backup Destination:’ ‘Remote FTP Server’ in drop-down list and fill in credentials of recently created “transfer” ftp account. Add your email address to receive notification when the backup process completes.
3.10. When backup is successfully created you will see something like backup-date-bill.tar.gz file in /home/destination/transfer directory. Unpack it to the current folder using either file manager in cPanel or shell. Inside you will see homedir.tar file or homedir directory. If you see homedir.tar file – unpack it.
3.11. Copy all files from unpacked transfer/homedir/public_html to public_second. If you carefully saved directory structure while addon domains creation all content should be reflected correctly.
3.12. Copy domains-directories from transfer/homedir/etc to /home/destination/etc. This way all email accounts will have the same passwords they had in the source account.
3.13. Copy maildirs from transfer/homedir/mail/ to /home/destination/mail to move your mail directories. Check whether maildirs are copied properly.
3.14. Go to transfer/mysql/ and use the following command to restore mysql dumps to the new databases in destination account:
mysql -u destination_user1 -p destination_sourcedb < source_sourcedb.sql.
After that put password for the destination_user1
3.15. The last step is the update of configuration files and path related links in all files. You can manually edit all files, but it will be better to use ‘replace’ utility bounded within mysql to perform the change. This utility is present almost on all cPanel based servers.
So move to public_second directory and run the following commands:
replace ‘/home/source/public_html’ ‘/home/destination/public_second’ — ./*
replace ‘source_sourcedb’ ‘destination_sourcedb’ — ./*
replace ‘source_user1’ ‘destination_user1’ — ./*
or
find ./* –type f | xargs replace ‘source_user1’ ‘destination_user1’ —
find ./* –type f | xargs replace ‘source_sourcedb’ ‘destination_billdb’ —
find ./* –type f | xargs replace ‘/home/source/public_html’ ‘/home/destination/public_second’ —
That’s it.