Script to transfer an restore mass cPanel accounts.

cPanel Data transfer.

*** Before performing the account transfer, please setup the servers to ‘SSH without password’ ***

The below given is the script to transfer.

  # vi!/bin/bash

for i in `cat /etc/trueuserdomains | awk -F: ‘{print $2}’`
/bin/echo “$i”
/scripts/pkgacct $i
file=$(ls /home/cpmove*$i*)
/bin/echo “$file”
scp -P PORT $file root@IP:/root
ls -lh $file
rm -rf $file

Change the PORT  and IP address accordingly.
PORT : SSH port of destination server
IP: The IP address of the destination server.

cPanel Data restoration.

The script is given below. Move to the location whether the cpmove files are located and then execute the following.

# ls cpmove-*.tar.gz  | awk -F- ‘{print $2}’ | awk -F. ‘{print $1}’ > file
# for i in `cat file`; do /scripts/restorepkg $i; done

Both comments and pings are currently closed.

Comments are closed.