That script was done during the COVID quarantine lockdown in 2020. I took the opportunity to migrate all my cPanel servers to CWP
I reported the bugs I encountered and submitted the script to the dev team, so hopefully they applied some of that to the migration script.
Yes, the vps1.domain.com was an old hostname from cPanel. Funny, I had stepped from regular hosting, to VPS, to advanced dedicated, then stepped down to dedicated, then down to a high end VPS at the end of my cPanel time. So I had about 5 mixed hostnames in the cur directories, so I wanted to normalize them on the new server under CWP. So I only showed one example in the posted script. In reality I had 5 hostnames to contend with!