English  France













If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.



Reply
  #1 (permalink)  
Old 01-24-2009, 12:29 PM
UnderHost's Avatar
UnderHost Management
 
Join Date: Jul 2008
Posts: 581
Default CPanel: Backup and Restore a Domain Account via SSH

Sometimes there is a need to backup a CPanel account without logging into the endusers CPanel yourself.

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

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

In 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
su - root



(See our server security tutorial for more information on this login procedure)



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

cd /scripts


3. Execute the CPanel script for the account backup:
./pkgacct username

(replace the username with the actual acount username that you are going to backup (/scripts/./pkgacct username))

The screen output will look similar to this:


Copying domain 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. 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
su - root



(See our server security tutorial for more information on this login procedure)



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


4. Execute the appropriate CPanel script for the account restore:
/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.
__________________
UnderHostProviding Affordable and Quality USA Hosting & Offshore cPanel Hosting
24/7 Rapid Support / 99.9% Uptime Guarantee / Shared / Reseller / VPS / Dedicated
Premium VPSUSA Cloud Virtual Private Servers - Dedicated and Scalable Resources - Parallels® Virtuozzo
Hong Kong - Singapore - USA - Canada - Netherlands - UK - Germany - Panama - Malaysia
Reply With Quote
underhost.us
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Loading...


All times are GMT -4. The time now is 02:05 AM.
Copyright © 2010 UnderHost Networks Ltd






Partners
Underhost Facebook  Underhost Twitter

Copyright © 2011 UnderHost Networks Ltd