WHM cpconftool Script
export config - Export only the WHM settings to a new server?
Back up a configuration module / restore - how to export whm server configuration
Clone a cPanel server configuration to a new server



Is there anything within WHM that I can export which will show the current config versions of things
such as PHP, MYSQL, Apache, PHPSU/Mod Ruid2 etc etc.
I would like to export only the settings I have already made.
How to: General Settings, Apache, Preferences ...
I do not want to configure everything again, is there any solution to this, besides the transfer tool?
, < Modules


--------------------------------------------------------------------
Modules WHM Backup / Restore
--------------------------------------------------------------------


  • Apache cPanel & WHM uses Apache to host websites.
  • AutoSSL The AutoSSL feature automatically issues free, Domain-Validated SSL certificates to users domains.
  • Backups cPanel & WHM uses backups to copy or archive data. You can use this data to recover to a previous state.
  • cPanel themes cPanel & WHM uses cPanel themes to generate the cPanel and the WHM interfaces.
  • cPHulk The cPHulk service helps to protect your server against brute force attacks.
  • Exim cPanel & WHM uses Exim as the servers main mail transfer agent.
  • GreyListing The Greylisting feature defends email users against spam.
  • ModSecurity This open-source web application firewall helps to detect and prevent intrusion. For more information.
  • MySQL cPanel & WHM uses MySQL as the servers database management.
  • WHM (whmconf) cPanel & WHM uses the whmconf service to back up and restore WHMs common settings that arent user-specific. For example, the settings from WHMs Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings) and WHMs Basic WebHost Manager Setup interface (WHM >> Home >> Server Configuration >> Basic WebHost Manager Setup).


--------------------------------------------------------------------
Backup / Restore Modules
--------------------------------------------------------------------



:
 usr/local/cpanel/bin/cpconftool --option
--option / + list-modules

--modules (Required) A comma-separated list of the modules to restore or back up.
--backup Generate a backup file.
--restore Restore from a backup file.
--list-modules List the available modules on your server.

--query-module-info List information about the version of the module.
--verbose Display details about the operation that the script performs.
--prerestore_backup Restore the original version of the file.



:
/usr/local/cpanel/bin/cpconftool --list-modules
list-modules :

HTML:
cpanel::easy::apache
cpanel::smtp::exim
cpanel::system::autossloptions
cpanel::system::backups
cpanel::system::greylist
cpanel::system::hulk
cpanel::system::modsecurity
cpanel::system::mysql
cpanel::system::whmconf
cpanel::ui::themes
--------------------------------------------------------------------
Backup a configuration module
--------------------------------------------------------------------

Configuration 10

:
/usr/local/cpanel/bin/cpconftool --backup --modules=configuration::to::backup
configuration::to::backup cpanel::system::whmconf


:
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::easy::apache
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::smtp::exim
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::system::autossloptions
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::system::backups
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::system::greylist
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::system::hulk
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::system::modsecurity
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::system::mysql
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::system::whmconf
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::ui::themes
list-modules

modules

:
/usr/local/cpanel/bin/cpconftool --backup --modules=cpanel::easy::apache,cpanel::smtp::exim,cpanel::system::autossloptions,cpanel::system::backups,cpanel::system::greylist,cpanel::system::hulk,cpanel::system::modsecurity,cpanel::system::mysql,cpanel::system::whmconf,cpanel::ui::themes


:
Backup Successful
/home/whm-config-backup-1562881772.tar.gz
--------------------------------------------------------------------
Restore configuration settings
-------------------------------------------------------------------

Configuration 10

:
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=configuration::to::restore
configuration::to::restore cpanel::system::whmconf


:
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::easy::apache
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::smtp::exim
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::system::autossloptions
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::system::backups
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::system::greylist
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::system::hulk
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::system::modsecurity
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::system::mysql
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::system::whmconf
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz --modules=cpanel::ui::themes
list-modules

modules

:
/usr/local/cpanel/bin/cpconftool --restore=/home/backup.tar.gz  --modules=cpanel::easy::apache,cpanel::smtp::exim,cpanel::system::autossloptions,cpanel::system::backups,cpanel::system::greylist,cpanel::system::hulk,cpanel::system::modsecurity,cpanel::system::mysql,cpanel::system::whmconf,cpanel::ui::themes


restore=/home/backup.tar.gz





The script removes any configuration files on the destination server that did not exist the source server.

When you restore a configuration module, the following actions occur:
The system restores all of the configuration files.
The /usr/local/cpanel/bin/cpconftool script tests whether the configuration settings are valid.

The /usr/local/cpanel/bin/cpconftool script runs the /usr/local/cpanel/scripts/buildeximconf script.
If the test fails, the script reverts the changes.
If the test succeeds, the script restarts the service.


The restoration process returns output that resembles the following example:


Restore Successful
---
cpanel::system::whmconf:
post_restore:
status: 1
statusmsg: Update WHMhostmgr Succeeded
restore:
data:
warnings: []
status: 1
statusmsg: "Whostmgr::Config::Restore::System::WHMConf: ok"
----------------------------------------------------------------

----------------------------------------------------------------

Cloning should include:


  • Tweak Settings (i.e. /var/cpanel/cpanel.config)
  • Exim Configuration
  • Feature Lists
  • Packages
  • Custom EasyApache Profiles
  • Reseller ACLs
  • Statistics Software Configuration
  • Update Preferences
  • /var/cpanel/rpm.versions.d
  • Other settings to be defined


Cloning should explicitly exclude:


  • IP Addresses
  • Nameservers
  • Hostname
  • cPanel Accounts
  • Anything that is server-specific


:
https://documentation.cpanel.net/dis...onftool+Script
https://docs.cpanel.net/whm/scripts/...ool-script/84/
https://forums.cpanel.net/threads/export-config.665433/
https://forums.cpanel.net/threads/ex...server.647121/
https://www.hostgoi.com/my/knowledge...anguage=arabic