The simple answer is yes. You can move a site or sites to another server using a cPanel backup file. The normal way to do this would be from WHM on the receiving server using the "Transfers" function, but you can also do it from the losing server side if that doesn't work.
Because I just went through what you're going through with HFW and because the wording of your question, I suspect that that's the situation you're in: The old server won't accept the transfer request from the new one. So here's how I transferred several dozen accounts out of HFW's service even though the server at HFW refused to accept the connection from the receiving server.
This method assumes some prerequisites:
- Both servers are running, of course.
- You are root on both servers.
- You have both root passwords.
- You have at least SSH to the losing server. (WHM is not needed.)
- Presumably, you'd have access to WHM on the new server. But you can actually restore from the shell if you need to.
The procedure is simple:
Log into the losing server as root using your SSH client of choice. (I like puTTY.)
cd again to the most recent backup subdirectory. Then look in the "accounts" subdirectory.
du -bsh * to see what's in there, with file sizes. The backup files will be in the format username.tar.gz. If there's already a recent-enough backup, then you don't need to make one.
If there does not exist a recent-enough backup for the account you need, then make it. Rather than my wasting keystrokes, the link to how to do that is at https://documentation.cpanel.net/display/68Docs/The+pkgacct+Script . You can also restore backup files from the shell on the new machine if you want or need to. That information's in there, too.
One there exist backup archives for the account(s) you need to move, use SCP to get them to the new server. You'll want to send them to /home on the new server because that's where WHM will look for them.
Assuming that the user account is somesite, that the archive is somesite.tar.gz, and that the receiving server's hostname is the.newserver.com, the SCP syntax would be:
$ scp somesite.tar.gz [email protected]:/home
You can also use the receiving server's IP rather than the hostname. Either way, once you enter the SCP command, you'll be prompted for the root password of the receiving server. Enter the password, and the transfer will start.
- Once the transfer is finished, go to WHM on the new machine and in the Backup section, select "Restore a Full Backup/cpmove File." Then select "Restore with Username." WHM will look in /home, find the backup, and offer to restore it for you. Unless the archive is corrupt, this almost always works quickly and flawlessly.
And that's that as far as moving the account to the new server is concerned. It doesn't change the DNS on the old server, however, so you have to make some DNS changes. What those exact changes are depend on how the two servers are configured, so more detailed information about your situation would be needed.
At a minimum, you should change the A entries on the old server to point to the site's new IP. As for the rest, more information about your situation is needed to further advise on the specifics.
Just while we're on the subject of backups, if you save your backups to Amazon S3 or some other cloud service in addition to /backup on the server itself, you can reimport the sites to a new server in a similar manner. From the new server, you'd pull the backup files to /home using whatever transfer protocol the cloud provider supports (SCP, rclone, or whatever); or push them from the cloud to /home on the new server, again using whatever supported, secure protocol the provider supports. Whichever way you do it, once the backup files are in /home on the new server, you can restore the account(s) using WHM.
The reason I say this is because I lost a ~60GB account during the HFW fiasco, but because I had a backup on S3, I was able to restore it in 19 minutes. Having a backup stored elsewhere than on the server itself allows you to restore your sites to any cPanel-equipped server in the Internet-connected world, even if your hosting company crashes and dies altogether. If you value your data, it's something I suggest you think about.