Category Archives: Hosting

cPanel account transfer on command line

Login your Old server SSH via root user and use these commands.

root@OLD[~]#cd /home
root@OLD[~]#/scripts/pkgacct

Once package account process completed, You can view backup file like cpmove-cpuser.tar.gz

Transfer account to another NEW server using RSYNC or SCP commands.

root@OLD[~]#rsync -avz –progress /home/cpmove-cpuser.tar.gz root@:/home

User this command if your server have different SSH port.

root@OLD[~]#rsync –progress –stats -avz –rsh=’ssh -p5093′ cpmove-user.tar.gz root@:/home/

Once transfer completed goto NEW server SSH and restore account.

root@NEW[~]#/scripts/restorepkg oldcpuser

mysql dump all datbases to separate files

This is fast way to backup all MySQL database to separate files:

back_dir=/backups/databases/$(date +'%F')
mkdir -v -p $back_dir

mysql -s -e 'show databases' | egrep -v "information_schema|performance_schema" | while read db; do mysqldump -h localhost --single-transaction --events --ignore-table=mysql.event $db > $back_dir/$db.$(date +'%F').sql; [[ $? -eq 0 ]] && gzip $back_dir/$db.$(date +'%F').sql ; done