Migrating cPanel / WHM accounts using SSH

Posted on May 22, 2014 by Vasily Bezruchkin Vasily Bezruchkin

cPanel / WHM comes with a powerful backup and restore feature. Let’s learn how to use this feature via command-line / SSH.

Backing up singular accounts with cPanel via SSH

Backing up a singular account is easy. Simply issue the following command to backup a cPanel account named ‘intellia’:

/scripts/pkgacct intellia

This particular script, ‘pkgacct‘ generates a ‘cpmove‘ .tar.gz file. This file will be stored in the home directory of your server, i.e:

/home/cpmove-intellia.tar.gz

Restoring an account with cPanel via SSH

Restoring an account from a ‘cpmove’ or auto-generated cPanel backup file is just as easy as backing one up.

To restore a ‘cpmove’ file, you will firstly need to make sure that the account is terminated:

/scripts/killacct intellia

Now, you can initiate a complete account restoration via the ‘restorepkg’ command:

/scripts/restorepkg intellia

Note: the ‘cpmove’ file will need to be moved to the /home/ directory in order to initiate the above command successfully.

The latter command can be used to restore a generic auto-generated cPanel backup file (this will overwrite existing files if the account already exists and is generally not recommended)

Backing up all accounts on a cPanel Server via SSH

If you would like to backup all accounts on a cPanel / WHM server, simply issue the following command:

/scripts/cpbackup

← Назад к блогу

Close

Напишите нам

Задайте нам вопрос и мы с удовольствием на него ответим. Оценка стоимости проекта бесплатна.