{"id":3534,"date":"2010-01-27T21:24:26","date_gmt":"2010-01-28T02:24:26","guid":{"rendered":"http:\/\/underhost.com\/blog\/?p=3534"},"modified":"2016-02-27T21:25:16","modified_gmt":"2016-02-28T02:25:16","slug":"cpanel-backup-and-restore-a-domain-account-via-ssh","status":"publish","type":"post","link":"https:\/\/underhost.com\/blog\/cpanel-backup-and-restore-a-domain-account-via-ssh\/","title":{"rendered":"CPanel: Backup and Restore a Domain Account via SSH"},"content":{"rendered":"<div class=\"smallfont\"><strong>CPanel: Backup and Restore a Domain Account via SSH<\/strong><\/div>\n<hr size=\"1\" \/>\n<div id=\"post_message_543\">Sometimes there is a need to backup a CPanel account without logging into the endusers CPanel yourself.<\/p>\n<p>In those situations the account can also be backed up via SSH.<\/p>\n<p>Every CPanel server comes with scripts that can be executed via SSH.<\/p>\n<p>In this case we will use the script:<\/p>\n<p>pkgacct from the \/scripts folder on your server.<\/p>\n<p>1. Log into your server by using SSH<br \/>\n* Change to the root user<br \/>\nsu &#8211; root<\/p>\n<p>(See our server security tutorial for more information on this login procedure)<\/p>\n<p>2. Change directories to the script directory by executing the following command:<\/p>\n<p>cd \/scripts<\/p>\n<p>3. Execute the CPanel script for the account backup:<br \/>\n.\/pkgacct username<\/p>\n<p><i>(replace the username with the actual acount username that you are going to backup (\/scripts\/.\/pkgacct username))<\/i><\/p>\n<p>The screen output will look similar to this:<\/p>\n<p>Copying domain Config\u2026Done<br \/>\nCopying Mail files\u2026.Done<br \/>\nCopying proftpd file\u2026.Done<br \/>\nCopying www logs\u2026Done<br \/>\nGrabbing mysql dbs\u2026Done<br \/>\nGrabbing mysql privs\u2026Done<br \/>\nCopying mailman lists\u2026.Done<br \/>\nCopying mailman archives\u2026.Done<br \/>\nCopying homedir\u2026.Done<\/p>\n<p>4. The backup file will be placed in the users home directory.<br \/>\nYou can now access the file and copy or move it to your backup drive or download it via ftp.<\/p>\n<p><b>How to restore a Domain Account via SSH<\/b><br \/>\n1. Upload or copy the backup file (Example File Name: cpmove-joeuser.tar.gz) to the domain account Home directory via FTP.<\/p>\n<p>2. Log into your server by using SSH<br \/>\n* Change to the root user<br \/>\nsu &#8211; root<\/p>\n<p>(See our server security tutorial for more information on this login procedure)<\/p>\n<p>3. Change directories to the script directory by executing the following command: cd \/scripts<\/p>\n<p>4. Execute the appropriate CPanel script for the account restore:<br \/>\n\/scripts\/restorepkg username<\/p>\n<p>(replace username with the domain account username)<\/p>\n<p>(make sure that the file name matches the necessary naming convention &#8211; follow the naming scheme seen in our example)<\/p>\n<p>This will restore the domain account from the backup, as well as it will create the CPanel account.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3534","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/3534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/comments?post=3534"}],"version-history":[{"count":1,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/3534\/revisions"}],"predecessor-version":[{"id":3535,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/posts\/3534\/revisions\/3535"}],"wp:attachment":[{"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/media?parent=3534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/categories?post=3534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/underhost.com\/blog\/wp-json\/wp\/v2\/tags?post=3534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}