There are situations where you might need to manually transfer the entire or some part of your server configuration to another cPanel server. We have the /usr/local/cpanel/bin/cpconftool script that you can utilize for this specific purpose. Using the script all of the server's configuration is broken down into certain modules which correspond to specific services/interface in WHM. Here is the list of all the available modules:
You can manually transfer only a specific section of the server configuration by transferring only one of these modules. Here, for demonstration, we only attempt to transfer the cpanel::easy::apache module, but you can choose any other or all the above modules at the same time.
For general information about the cpconftool script, you can refer to the following article:
Here we are transferring from a "source server" to a "destination server".
1- BackUp EasyApache's configuration on the source server using cpconftool:
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::easy::apache
Note: This will create an archive file under /home/. Also, you need to make sure that when running the command the "backup successful" message and a path to the backup file are shown.
2- Use your preferred tool to transfer the above backup file to the destination server. Here rsync is used since it's assumed that we have root access to both the destination and source server:
rsync -e ssh --info=progress2 $SERVER_IP:/home/whm-config-backup-cpanel__easy__apache-1.0.0-1620916318.tar.gz ~/
Note: This command needs to be run from inside the destination server and the $SERVER_IP here should be replaced by the IP of the source server.
3- Then you need to restore the configuration file using the following command:
/usr/local/cpanel/bin/cpconftool --restore=/path/to/file.tar.gz --modules=cpanel::easy::apache
If successful you should be able to see the following message:
/usr/local/cpanel/bin/cpconftool --restore=/home/whm-config-backup-cpanel__easy__apache-1.0.0-1620916318.tar.gz --modules=cpanel::easy::apache
statusmsg: EA4 profile installed.
statusmsg: "Whostmgr::Config::Restore::Easy::Apache: ok"
If all the above steps are completed without any error, then that means that you have successfully transferred the cpanel::easy::apache module (basically EasyApache's configuration) to the destination server. The same procedure can be used for any other module.