BuycPanel Blog

BuycPanel Blog

Latest news and updates

A Brief Overview of the cpconftool Script

Posted by Allura on 05 12 2018.

Introduction
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…

Introduction

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:

/usr/local/cpanel/bin/cpconftool –argument

Arguments

  • Argument: –restore
  • Description: Need to restore a backup file. For more information, one can read the Restore a configuration
  • Example:

 –restore=/home/whm-config-backup-all-1.1-1411229033.tar.gz

2- Argument: –backup         

  • Description: Need to generate a backup file. For more information, one can read the Back up a configuration
  • Example:

–modules=cpanel::smtp::exim –backup

3- Argument: –list-modules       

  • Description: Need to list the available modules on one’s server.
  • Output will come out as:

cpanel::smtp::exim

4- Argument: –modules              

  • Description: Need a comma-separated list of the modules to restore or back up.
  • Example:

–modules=cpanel::smtp::exim –backup

Back Up a Configuration

Steps:

  • 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:

bin/cpconftool –list-modules

A list of available configurations will thus be displayed by the system such as:

cpanel::ui::themes

  • 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:

Backup Successful

/home/whm-config-backup-configuration__to__backup-10.550000-1452006507.tar.gz

Configuration Backup Contents

When a configuration is being back up, the system backs up the following files for each type of configuration:

Apache Configuration…

Example:

/etc/cpanel/ea4

/var/cpanel/easy

Backups Configuration…

Example:

/var/cpanel/backups/config

/var/cpanel/backups

/var/cpanel/backups/extras

cPanel Theme Configuration…

Example:

/var/cpanel/activate/features/set_paperlantern_as_default

/var/cpanel/activate/features/paper_lantern

/var/cpanel/customizations/*

Exim Configuration…

Example:

/etc/exim.conf

/etc/exim.conf.local

/etc/exim.conf.localopts

MySQLR Configuration

Example:

/etc/my.cnf

WHM (whmconf) Configuration

Example:

/etc/cpupdate.conf

/etc/wwwacct.conf

The examples and output, however can be more than it is showed.

Conclusion

This feature helps in backup, restore and transfer server configurations with certain technical steps.