Manually Splitting a cPanel Account into Two cPanel Accounts / A New Account
Hi,
I'm looking for some advice/help in migrating websites across from one cPanel account to another cPanel account...
# Scenario 1:
- We have a cPanel account (exampleaccount) with 3 websites on it (each website is in a subfolder)
- We have a cPanel account (newaccount) where we want to migrate one of the above websites across to.
- It would need /public_html/website/ transfered from one account to another which I assume I can do with: mv /home/exampleaccount/public_html/newwebsite/ /home/newaccount/public_html/newwebsite
- How would I migrate the mysql database across?
- How would I migrate the domain across? Would i have to quickly delete the domain and re-add it on the newaccount?
# Scenario 2
- We have a cPanel account (themainsite) with 4 websites on it (each website is in a subfolder)
- We want to setup a cPanel account, however the domain is already in use under the cPanel account: themainsite so when we try and setup an account it errors out because it's already in use.
How do we migrate the domain, database & files across?
In both scenarios we would want to update the database's name / username to match the new account's username and then we would manually update the config.php
It would be great if we could do all of this by SSH / command line to make it as fast as possible to setup accounts, delete domains, add the domain to the new account... etc
Anyone have any idea
-
Hi RyanR, I think the easiest way is to use the "Convert Addon Domain to Account" feature in WHM to split up your accounts and then do a backup/restore of the database to the new account. 0 -
Hi RyanR, I think the easiest way is to use the "Convert Addon Domain to Account" feature in WHM to split up your accounts and then do a backup/restore of the database to the new account.
Thanks for that advice Michael. Does that migrate the files for that website though? > then do a backup/restore of the database to the new account. Is there no way to run a command to migrate it to a different account? Also it doesn't help with scenario 1 where i want to migrate a website from one cPanel account to another cPanel account.0 -
Thanks for that advice Michael. Does that migrate the files for that website though? > then do a backup/restore of the database to the new account. Is there no way to run a command to migrate it to a different account? Also it doesn't help with scenario 1 where i want to migrate a website from one cPanel account to another cPanel account.
Ahh... ok. A standard approach for both scenarios would be: - rsync the addon domain directory to the other cPanel account - delete addon domain and create the addon domain on the other account - Create database + database user on the new account - backup the database and restore to the new database (can be done through phpmyadmin) - Change database settings on the webapp (i.e. wp-config.php if a Wordpress site)0 -
The convert addon domain to account feature includes the site data and the databases. I would suggest reading through the following: Convert cPanel Addon domain to Account | cPanel Blog 0 -
That works for scenario 2 but doesn't help for scenario 1 where we want to migrate an account/domain from one account to another...
I'm not understanding how it wouldn't resolve Scenario 2, unless you mean that you're just trying to move the addon domain to a different account but not create its own account. In that case yes you'd have to move the site data manually and reassign ownership of the databases to the new cPanel user.0
Please sign in to leave a comment.
Comments
6 comments