how to create multiple backups in WHM /command line

techni

Member
Jun 22, 2012
8
0
1
cPanel Access Level
Root Administrator
I need to transfer all the accounts from one server to another
Instead of "Copy multiple accounts/packages from another server" this option in WHM

How can i take the backup of all the accounts through command line and restore the same on another server
 

pwhjenny

Well-Known Member
Aug 31, 2012
138
0
91
cPanel Access Level
Root Administrator
Usually, you need to use /scripts/pkgacct user command to take backup of individual accounts. But if you want to take backup of all accounts. You will need to design simple script.. You may refer following one that i sometime use.

First make sure you setup keys between two servers so you wont be asked to enter password each time.

Here is the script.

cd /var/cpanel/users
ls -d * > users.txt
cat /var/cpanel/users/users.txt | while read a; do /scripts/pkgacct $a; done
rsync --progress --partial -avz --rsh='ssh -p 743' /home/cpmove-$a.tar.gz [email protected]:/home/
Here 743 is ssh port number of remote server.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator