Backing up and restoring accounts to a new server

Discussion in 'cPanel HOWTOs and Tutorials' started by Dan, Aug 8, 2007.

  1. Dan

    Dan Moderator


    This tutorial uses SSH on both the new and the old server and backs up and then restores using CPanel scripts. It also assumes you have enough disk space on your old server to hold the backups. If not you can use the WHM backup utility and try to FTP the backup to your new server.

    1) Log into your old server via SSH

    2) cd /home

    3) /pkgacct USERNAME
    Replace USERNAME with the account's user name of course.
    This will create a tar.gz file in your /home directory.

    4) mv cpmove-USERNAME.tar.gz /home/USERNAME/public_html
    Move the file to where you can get it.

    Own the file to the user so it can be accessed.

    6) Log into your new server using SSH.

    7) cd /home

    8) wget http://www.DOMAIN.COM/cpmove-USERNAME.tar.gz
    Replacing DOMAIN.COM with the domain name being moved of course.

    9) /scripts/restorepkg USERNAME
    This should restore all files, databases, and create a new DNS zone for the domain.

    10) Log into WHM and verify settings. You will most likely need to recreate the package.

    11) rm -f cpmove-USERNAME.tar.gz

    12) switch back to the old server and rm -f cpmove-USERNAME.tar.gz

    And you should be good to go! Rinse and repeat for each account being moved :)
  2. bigu_c

    bigu_c New Member

    On old server, i haven't SSH permission to access my account and total files locate on it is: 4GB

    Are there any ways to compress all of them to zip file and wget to new server (on

    Please help me!

    Thank you!
  3. Dan

    Dan Moderator

    Hello Bigu_c,

    Sure there is, as stated in the first paragraph you can try using WHM's backup utility and FTPing it directly to the new server. You can also try using CPanel's backup utility (assuming you have the disk space on your old server) and then moving the file to where you can access it and then use wget to copy it to the new server.

    These are rather involved options though and you may want to take advantage of Knownhost's offer to move your accounts over for you.

    Hope that helps
  4. lolak08

    lolak08 New Member

    thanks for the tutorial - i did not need ssh access for the old server, i have done from cpanel backup features. :D
  5. Dan

    Dan Moderator

    You're welcome lolak08 :)

    And welcome to KH!
  6. prasham

    prasham New Member

    I have very basic knowledge of cpanel.

    Now I had created backup yesterday and tried to install a MOD but it went wrong and hence I want to restore the backup.

    Backup is located on the the server itself.

    How do I restore the backup? Please help.
  7. Dan

    Dan Moderator

    Hello prasham,

    Steps 6-9 in the original post should work for you.

Share This Page