When migrating multiple cPanel accounts from one server to another, it’s essential to first create individual account packages. Start by creating a file named Migrating-Accounts.txt, listing all usernames you wish to migrate. Then, set up a Migration directory to store the packaged files. Use the following command to package and move each account:
for i in cat /home/Migrating-Accounts.txt; do /scripts/pkgacct $i; mv /home/cpmove-$i.tar.gz /home/Migration/; done
For bulk reseller account migration, retrieve all usernames with:
cat /etc/trueuserowners | grep username | awk ‘{print “/scripts/pkgacct “$1}’
or create a username list using:
cat /etc/trueuserowners | awk ‘{print $1}’ > 1.txt
(remove any colons “:” from the file).
Then run:
for i in cat 1.txt; do /scripts/pkgacct $i; mv /home/cpmove-$i.tar.gz /home/Migration/; done
After packaging, move the Migration directory and 1.txt file to the destination server, and restore all accounts with:
for i in ‘cat 1.txt‘; do /scripts/restorepkg $i; done
This method ensures a smooth, efficient transfer of single or reseller cPanel accounts between servers.