Backup and Restore a Domain account via SSH on Linux Server

In some situations, the account can also be backed up via SSH.

Every CPanel server comes with scripts that can be executed via SSH.

 

 

For this case we will use the script pkgacct from the /scripts folder on your server.

1. Log into your server by using SSH

* Change to the root user if not by

[email protected][#]su – root

2. Change directories to the script directory by executing the following command:

[email protected][#]cd /scripts

3. Execute the CPanel script for the account backup:

[email protected][#]./pkgacct username

(replace the username with the actual acount username that you are going to backup)

The screen output will look similar to this:

Copying domain Config…DoneCopying Mail files….DoneCopying proftpd file….DoneCopying www logs…DoneGrabbing mysql dbs…DoneGrabbing mysql privs…DoneCopying mailman lists….DoneCopying mailman archives….DoneCopying homedir….Done

4. The backup file will be placed in the users home directory.

You can now access the file and copy or move it to your backup drive or download it via ftp.

How to restore a Domain Account via SSH

1. Upload or copy the backup file (Example File Name: cpmove-joeuser.tar.gz) to the domain account Home directory via FTP.

2. Log into your server by using SSH

* Change to the root  user if not by

[email protected][#]su – root

3. Change directories to the script directory by executing the following command:

[email protected][#]cd /scripts

4. Execute the appropriate CPanel script for the account restore:

[email protected][#]/scripts/restorepkg username

(replace username with the domain account username)

(make sure that the file name matches the necessary naming convention – follow the naming scheme seen in our example)

This will restore the domain account from the backup, as well as it will create the CPanel account. We have not tried to do a restore on top of an existing CPanel account yet,

but we have heard that this should work just fine. Please test accordingly..

 

If any feedback, queries are always welcome!

Share on Facebook0
Share on Google+3Tweet about this on TwitterShare on StumbleUpon0Share on LinkedIn0Share on Tumblr0Digg thisPin on Pinterest0Share on Reddit0Email this to someonePrint this page

About Abhijit Sandhan

Abhijit Sandhan
Loves Linux, Blogging, Traveling, Hiking and sharing knowledge!

3 comments

  1. Sweet web site , super layout, very clean.

  2. Thanks a ton for posting this, I found it really informative, and it answered most of the concerns I had.

  3. Thanks for posting this informative article.

Leave a Reply

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

CAPTCHA