BuycPanel Blog

BuycPanel Blog

Latest news and updates

How to Restore and Transfer a Configuration Using the Cpcomftool Script

Posted by Allura on 29 05 2018.

A brief outline of cpcomftool script:

Cpcomftool script is used when an account is migrated from one server to another. In this article you will come to know that how can you restore and transfer a configuration using cpcomftool script.

Restoring a configuration using cpcomftool script:

We know that before restoring some file or configuration we need to back up first so the procedure of restoring of configuration using cpcomftool starts with backup. The following steps will describe the procedure:

  1. Backup of configuration:- In order to backup a configuration, just do the following:
  • Log in through SSH as the root user and direct to the /usr/local/cpanel directory.
  • Now to list the available configurations, run this command: – bin/cpconftool –list-modules.
  • Now to complete the backup process Run the mentioned command, where configuration::to::backup represents the configuration name:-bin/cpconftool –backup –modules=configuration::to::backup

After completion of the backup the system will show a message



Backup Successful



  1. Configuration backup contents

After you backup a configuration, the system backs up the mentioned files for each type of configuration:

  1. Apache configuration.
  2. Backup configuration.
  3. cPanel theme configuration.
  4. Exim configuration.
  5. MySQL® configuration.
  6. WHM (whmconf) configuration.
  7. Now finally the restoration process begins

In order to restore a configuration from a backup file, run the command mentioned below, where backup.tar.gz represents the path to the desired backup file and config::to::restore represents the configuration to restore: – bin/cpconftool –restore=backup.tar.gz –modules=config::to::restore –prerestore_backup.

  • The system restores all of the configuration files.
  • The /usr/local/cpanel/bin/cpconftool script tests whether the configuration is valid.
  • The /usr/local/cpanel/bin/cpconftool script runs the /scripts/buildeximconf script. (a) Now if the test fails, the system reverts the changes. (b) And if the test succeeds, the system restarts the configuration.

How to Transfer the Configuration?

Now in order to transfer a configuration, just go through the following steps:

  1. Go through the backup process of the configuration of your wish on the source server.
  2. Then copy the .tar.gz file that is created in the backup process from the source server to the destination server.
  3. Then simply go through the restoration process of the configuration of your wish on the destination server.


Now you know the procedures of restore, backup and transfer of the configuration from one server to another using cpcomftool script with ease. And it is no longer hectic to set up an old account to new server.