A Brief Overview of the cpconftool Script
Posted by Allura on 05 12 2018.
This feature is for cPanel and WHM version 68.
The /usr/local/cpanel/bin/cpconftool script helps in backing up, restoring, and transferring server configurations. This can be useful when one wants to migrate the cPanel & WHM accounts to a new server.
One can use this script to back up, restore, and transfer these configurations:
- Apache — cPanel & WHM uses this Apache configuration in order to host websites.
- Backups — cPanel & WHM makes a use of this backups configuration as the system’s primary back up and restore tool.
- cPanel themes — cPanel & WHM uses this theme configuration in order to generate the cPanel and WHM interfaces.
- Exim — cPanel & WHM makes use of Exim as the system’s main mail transfer agent.
- MySQL® — cPanel & WHM uses this configuration as the system’s primary operations tool.
- WHM (whmconf) — cPanel & WHM uses this configuration to back up and restore WHM’s common non-user-specific settings (like the settings from WHM’s Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings) and WHM’s Basic WebHost Manager Setup interface (WHM >> Home >> Server Configuration >> Basic WebHost Manager Setup)).
The /usr/local/cpanel/bin/conftool Script
One needs to run the following command as the root user to use this script:
- Argument: –restore
- Description: Need to restore a backup file. For more information, one can read the Restore a configuration
2- Argument: –backup
- Description: Need to generate a backup file. For more information, one can read the Back up a configuration
3- Argument: –list-modules
- Description: Need to list the available modules on one’s server.
- Output will come out as:
4- Argument: –modules
- Description: Need a comma-separated list of the modules to restore or back up.
Back Up a Configuration
- One needs to log in as the root user via SSH and navigate to the /usr/local/cpanel
- One needs to run the following command in order to list the available configurations:
A list of available configurations will thus be displayed by the system such as:
- One needs to run the following command in order to back up the configuration, in which configuration::to::backup represents the configuration name:
bin/cpconftool –backup –modules=configuration::to::backup
The system thereafter will display a confirmation message:
Configuration Backup Contents
When a configuration is being back up, the system backs up the following files for each type of configuration:
cPanel Theme Configuration…
WHM (whmconf) Configuration
The examples and output, however can be more than it is showed.
This feature helps in backup, restore and transfer server configurations with certain technical steps.