Here I am gonna shed some light on the cPanel account Migration. Its simple, issue some scripts and let the server do it.
Suppose we need to move the cPanel accounts between servers. All we need to list the account usernames in the file test.txt. It would be like
user1
user2
user3
Okay.
Add sshkey in the Destination server, so that it makes the secure copy and ssh easier. Run this in a screen
===================================================
for i in `cat test.txt`; do /scripts/pkgacct $i; scp /home/cpmove-$i.tar.gz root@destinationIP:/home/; ssh root@destinationIP "/scripts/restorepkg /home/cpmove-$i.tar.gz"; done | tee transferresult.txt
===================================================
tee command can show up the result in a file. You can also set cpuwatch if required. This will keep the CPU load on the server
===================================================for i in `cat test.txt`; do /usr/local/cpanel/bin/cpuwatch N /scripts/pkgacct $i; scp /home/cpmove-$i.tar.gz root@destinationIP:/home/; ssh root@destinationIP "/scripts/restorepkg /home/cpmove-$i.tar.gz"; done | tee transferresult.txt
===================================================
Replace N with required value.
Comments
Post a Comment