Reseller account migration on different server by using script

A reseller account can have a number of shared server accounts and sometimes it becomes hard to manage and migrate all account from one server to another. The below script is an easy way for migrating Reseller and/or Bulk accounts between cPanel servers:

On source server : #

cd /home
mkdir /home/Migration
cat /etc/trueuserowners |grep reseller_username | awk '{print $1}' | cut -d: -f 1 > Migration.txt
for i in `cat Migration.txt`;do /scripts/pkgacct $i; mv /home/cpmove-$i.tar.gz /home/Migration/;done

On Destination server #

vi Migration.txt ( add all username which you want to restore)
cd /home/
rsync -va -e "ssh -p 22" [email protected]:/home/Migration/* /home/
for i in `cat Migration.txt`;do /scripts/restorepkg $i;done

Powered by BetterDocs