Tutorials, Web

How to Move Accounts From One cPanel Server To Another

This tutorial explains a simple, straightforward method for migrating cPanel accounts from one server to another. You can use this method to transfer accounts from an old server to a new one, help customers from another host move to your host, etc. This does not even require root access on one end of the migration. Basically, this is a more reliable method than the "Transfer Account from another Server" tool in WHM, which rarely works.

Requirements:
– cPanel on both servers
– WHM access on the new server (one that the accounts are being moved to)
– root access on the new server

Definitions
The server you are transferring the accounts from = "old server"
The server you are transferring the accounts to = "new server"

Instructions
1. Log into WHM of your new server and create a new account called "restore", or anything you like for that matter. Remember the FTP address, username ('restore', in this example), and account password. We will need these for later.

2. Log into the cPanel account you are wanting to transfer on the old server.

3. Click on "Backup >> Generate/Download a Full Backup".

4. Once here, select the backup destination to be "Remote FTP Server".

5. Enter your email address for verification, followed by all of the FTP account information for "restore", which we created on the new server.

-Remote Server: new server's address
-Remote User: restore
-Remote Password: restore's password
-Port: 21

Then, click "Generate Backup". This may take some time to backup the files, depending on how large the account is. You should receive an email provided in the above info once it is complete.

6. Now, log into SSH on your new server.

7. Type in the following commands:

cd /home/restore/public_html

ls

After running the list command above (ls), you should see the tar file of the account on the old server. This means that you have successfully sent the file via FTP to your new server.

8. Now move the tar file to your new server's /home directory with the following command:

mv tar_file_name /home

9. Now, log into WHM on your new server and navigate to "Backup >> Restore a Full Backup/cpmove file"

Once here, you should see the old account's username under "Possible cpmove archives found:".
If you do not, log back into SSH and be sure that the account's tar file has been moved into /home.

10. Type in the account name in the text field in WHM, which is proceeded by "Enter the username for the account you wish to restore:".

11. Click "Restore".

12. Repeat process for additional accounts.

Share

49 Comments

  1. Can you tell me how to "log into SSH on your new server"

  2. You can use a tool like WinSCP, it's free

  3. I can't login into SSH,
    Can tou show me the way how to migrate one account (or many account or one reseller accoount) to another acccount ?

    Thank you !

  4. If you can't login to SSH you may need to find another option – so you'll need to contact your host. Let me know what you find out!

  5. Hi Justin,

    Thanks for the information above. But it seems that I continuously receive an error that says the Account Creation Failed…that username is taken. I also attempted to –force the restore and received the same error message.

    Any ideas what I am doing wrong?

    Thanks

  6. Well are you trying to upload files for which the username is already taken? If you've followed all the steps directly and it's not working, I'd contact your host.

  7. Hey Justin,

    Thank you for the information above, do these steps grab all of their e-mails sitting on the old server as well?

    Cheers,

    Wes

  8. Wes,
    yes, as long as the emails are still on the server, they should be moved as well

  9. please tell me how to move a text file from one server to another by using a config file.

  10. I have logged into WHM on my new server but I cant find the option "Backup >> Restore a Full Backup/cpmove file". Is it in WHM or Cpenal?

  11. Do you not have a dedicated server? Maybe your host has disabled that feature…

  12. i do backup and receive in email:

    Can't call method "login" on an undefined value at /usr/local/cpanel/bin/ftpput line 28.

    any idea? thanks

  13. Thanks you for your tips. It was working perfectly.
    But I still got problem with mysql database.
    When I moving to the new server, some website of my clients cannot connect to database.
    Can some body help me regarding this problem?

    Regards,

    Afrizal

  14. How do you move the backup to the /home directory, what are the commands for that? Every tutorial I have found says to move it, but none say how to move it!

  15. NM I see it. I guess I'm blind, dumb, or both! Not sure I missed that part of the tutorial!

    Thanks!

  16. what happen if mysql server versions were different ?

    is it give bugs?

  17. I would do it this way.

    login to SSH
    run /scripts/pkgacct username
    (replace username with the cpanel username you wish to move)
    it will create the tar.gz of the complete account and place it on your /home/
    then transfer the tar file to the new server "/home" and then use whm or SSH to restore it. once this is done, I'll login to old server's WHM and edit DNS zone for this moved account and change the IP to the NEW ones and change the Nameservers to the new one, change the TTL (time to live) value from 14400 to 3600 seconds and save.

    Allow it 30 mins and then update the nameservers from the Domain registrar end. This way there shouldn't be any noticable downtime in most cases.

  18. Hi,

    thanks for the tutorial,

    How would i transfer multiple WHM accounts,plus the cpanels within the WHMs to a new server.

    Thansk

  19. @mohit

    How exactly do you move the tar file from old server home to the new server home?

  20. Thanks so much! Transfer went with ease this time around. Your instructions worked perfectly!

  21. I was trying this out. Did not create a restore account, but everything seemed to go well. On new server, tarball was unzipped and all messages said success and new account was created. But many folders and files were not restored, though all databases seem to be in place.

    Deleted all, tried again – and still files and folders only partially restored. No error messages anywhere.

    (I am a newbie to all this, so I may have missed something.)

    Any idea why this happens? Any help is appreciated 🙂

  22. I cannot figure out how to generate a complete backup using godaddy's hosting. They really suck for backend.

    Anyone know how I can get this done with godaddy hosting

  23. Do you know how to restore from a CPanel Full Backup if you don't have CPanel. Some dweebtard has sent me a CPanel backup but I have no idea how to access the MySql database.

    TIA!

  24. thanks for tutorial, very helpful. We are moving around 130 websites from one to host to another and I didnt know how to 🙂

  25. thanks, for this straight forward guide…

    but I must mention:

    backup files are going to /home/restore/ instead of /home/restore/public_html.

    if you want to generate backups in public_html dir you must enter public_html in the last textbox which named Remote Dir.

    thanks again for this tutorial…

  26. hi do yiou know if i can movce account from cpanel server to a host plan with godday …. actually i was in full deicated server with cpanel whm ok there i know how to moce account fromserver to server voa WHM bbut now i have to move from cpanel to godadday any idea how

  27. First Week Engaged: Highlights for the week of September 8 at Pretty Geek

    […] How to Move Accounts From One cPanel Server To Another […]

  28. Thanks for the tutorial!

    I did find a problem when attempting to do the restore in WHM on the new server when accessing it via Safari on a Mac. It kept complaining that there was no backup file from which to restore… I'd check and it had been deleted! Every time! I switched to FireFox and everything worked perfectly.

    I also used cp instead of mv to make a copy of the file and not move it… after having a couple deleted on me.

    To the person that asked about loging in via ssh… open a terminal application (it's in the Utilities folder on the Mac… not sure about Windows) and type the following…

    ssh -l username mydomain.com

    where:
    – username is your username
    – mydomain.com is your domain name of the new server

    My ISP uses a non-standard port for ssh. Instead of port 22, they use port 7288… so, I typed this instead…

    ssh -p 7288 -l username mydomain.com

    They also required me to create an SSH key. This is a way of securing ssh access to your server by telling the server in advance that you'll be logging in. In WHM, go to Security -> Manage SSH Keys and click on Import Key. Switch back to Terminal and type…

    ssh-keygen

    It should ask you for a password. This creates a hidden directory in your home directory called .shh and in it you'll find a file called, id_rsa.pub. Navigate to the directory and display the contents of the file by typing…

    cat /Users/username/.ssh/id_rsa.pub

    where:
    – username is your user name on your Mac

    Copy the text that it spits out and paste it in the public key field back in WHM.

    The next time you attempt to login via ssh, it should work.

    I realize that these instructions are Mac-specific but the ideas should be the same on Windows… just the method will be different. This tutorial helped me a lot so I thought that I'd just give back a little.

    Cheers!

  29. Suggestions for importing just a single addon domain from an existing cpanel account… Not the complete cpanel account just one or two separate addon domains?

  30. Great tutorial, if you still can not do it, I will move any site for $5.00 goto my site and open a ticket. http://client.myviphosting.com/client/submitticket.php

  31. Justin

    Have you got any idea how to access or change an admin username and password in PHPAdmin for a PHP Web script that I have installed?

    Cheers

    Ken

  32. If i'm transferring to the same domain, should i change the nameserver first before following the steps above?

    Thanks

  33. al prince nofl

    Really i wanna thank you so much.
    First the shell didn't open with me and still, so i tried the program "WinSCP" and it's great. i moved the backup to "home" by the "root" use sure.
    But i found program that i made the use that i wanna to make it my website user and transfered the backup to it, so when i tried to restore it says the user already exist so i deleted the user from WHM and restored the backup =]
    Best wishes ….
    Al Prince Nofl

  34. Just a quick question on step number 5 (about the Remote Server being the new server's address). If my old server's IP address is 174.XX.XX.XX, is that what I type in as the Remote Server? Do I have to provide a path or anything? If the backup file is sitting on the /home drive, then how does the syntax go?

    Thanks.

  35. I am face problem to transfer it. I think, you need to more specify. Like, I just want to transfer my site chotibd.com from previous hosting to new hosting. I just create backup from cpanel backup option. Now,I want to up on new server. First time I upload total zip file on backup home directory option of new server. But,my site now shown.Now, what I need to do?

  36. Cricut Cartridges

    Thanks for the writeup Justin. I just got a dedicated box and need to move all of my sites from my VPS.

  37. Excellent post, really helpful and shaved hours off the time I thought it was going to take.

  38. Hi Justin,

    I have about 70 websites on a dedicated server (all with separate cpanel logins for which I have all the login information for). My server host is not responsive and I get the feeling they might go out of business. I am losing sleep over the thought that I might wake up one day to find all my sites gone. Somehow I need to yank all of these off this server (which I pay dearly for each month) and put them on a new dedicated server (through a provider that is more stable and offers some level of customer service—vs none as I have now).

    Getting help on the other side (to help move them) is unlikely and sure to be extremely unpleasant. I understand the one-by-one process you have outlined…but is there some way to automate the process given that I have 70 sites?

    **Lastly, will this process move all the files, or just the files directly utilized by the website itself? For instance, I have a lot of information that lies outside the public_html side of things.

    Thank you kindly.

  39. Cricut Cartridges

    Thanks for the writeup Justin. I just got a dedicated box and need to move all my sites from my VPS.

  40. The article is very much informative but my host says "Let we do for you" while I am not willing to do so please help. I like to do it myself.

  41. I failed to restore the the back up. I am newbie and I am seeking the help of you. After going to restore>>restore back up. But it is not working.

  42. AS a Newbie I do not know what WHM, SSH and VPS are. Please don't use jargon without explaining what it means – remember you were a newbie once too. By the way apart from jargon, a good step by step guide.

  43. I have a question regarding the password part. Since each cPanel account has its own password that was setup by the account owner, will the password be restored when we unzip the tar file under WHM? You've mentioned that we need to create a username "restore" and password under new WHM. So, I wonder how can we keep the owner's password instead of using our new password? Thank you.

  44. Hi! I know this post is old but I'm hoping you can help me.

    I have just used this method to move a client over from HostGator to my hosting company. My only issue is that when I restored his backup file, it made me delete the account I had made for him (still not too big of a problem) – the problem is that I cannot now CHANGE his package to one of the ones I offer. It still has the package named "Baby Croc" from hostgator's account. When I modify the account the option to change it is not provided. Any ideas?

  45. Oh! Nevermind, I'm a bit daft, lol. The option to do so is under "List accounts" not "Modify an account" – for any other airheads out there wondering 🙂

  46. I want to move a website I created as a sub domain to a different cpanel. I have already uploaded the files and they are working well but upon importing the database I get this error: Database Error: Unable to connect to the database:Could not connect to MySQL.
    Its a joomla website and I have tried to edit the configuration.php and the database (sql file) to correspond to the settings of the new website but its not working. NB: I removed the 'create database tag in the .sql which enabled me to import the database.
    What is it that am not doing?

  47. Thanks for posting this. Been a nightmare moving all these sites and trying to do it the easiest way!

  48. Thanks for this tutorial Justin. Just moving some accounts today from one HostGator account to another.

  49. After attempting to restore, WHM says:
    Cannot restore. That user already exists on this system

    So I need to delete the account I created right? O.o

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image