Previous Post: WHM Scripts

Now we’re going to start looking into some of those SSH commands.  Today we’ll be going over the commands pkgacct and restorepkg.

Backing up and restoring cPanel account’s is, in my opinion, faster by using the command line as you don’t have to wait for a sometimes sluggish web interface to load.

Let’s get started then, shall we?

1. Login to your server as root via SSH.

root@lolwut [~]#

2. Type: /scripts/pkgacct username (replace username with the acount username you wish to backup)

root@lolwut [~]# /scripts/pkgacct clayton

3. Now you’ll (hopefully) see something like this on your SSH screen:

Copying Reseller Config…Done
Copying Mail files….Done
Copying proftpd file….Done
Copying www logs…Done
Grabbing mysql dbs…Done
Grabbing mysql privs…Done
Copying mailman lists….Done
Copying mailman archives….Done
Copying homedir….Done

4. There should now be a file in that users /home/ directory named “cpmove-username.tar.gz” where “username” is the username you specified in Step #3.

5. Download the cpmove-username.tar.gz and save it. (You can use your FTP software to login to the server and download the file)

Now we’re going to restore the backup we just made.

1. Upload cpmove-username.tar.gz to the webserver’s /home directory.
(You can use your FTP software to login to the server and upload the file)

2. Type: /scripts/restorepkg username
(replace username with the account username)

This will restore the site, and also create the cPanel account.

Bookmark and Share