Script to restore the contents from addon domain to a newly created domain
When customers move from shared hosting to VPS environment/dedi server environment below-pasted script will be usefull. In shared server’s customer’s will be having most of the domain’s as addon domains. Using the below-pasted script they can separate these domains
example1.com. example2.com example3.com (newly created domain which is separated from main account)
#!/bin/bash
b=(example1.com. example2.com example3.com)
a=(username1 Username2 username3)
c=${#a[@]} #length of array
for ((i=0;i<c;i++));do cp -pav /home/mainaccount_username/${b[i]}/* /home/${a[i]}/public_html/; chown -R ${a[i]}. /home/${a[i]}/public_html/* ; done
If you need any further assistance contact me @ [email protected].. prefer hangout ?