We have created several scripts which will convert your cPanel server into CWP.
Last Update: 13.09.2021

How does this work?
- First, we export from cPanel all user account details into temporary files so we can later import them into CWP.
- Second, we create a backup of cPanel and uninstall it.
- Third, we install CWP, this is the regular CWP installation process.
- Fourth, we import data into CWP from the exported files of the first step.

REQUIREMENTS
- CentOS 7 latest version
- MySQL 5.7+ or MariaDB (Recommended MariaDB)
- Make sure you don't have any MySQL connection timeout limits
- Change MySQL root password to something without special characters
- Remove CloudLinux
- Mailbox format should be maildir, those using mdbox will need to convert to maildir before removing cpanel
* Info about mailbox format you can check in WHM under Mailbox Conversion

How safe is this?
- On the first step after the script run, you get information about exported data from the cPanel.
- First script run doesn't make any changes to the system so you can check and confirm that all is covered.
- User Accounts: All user files in /home/USERNAME are not touched so server accounts are safe.
- MySQL Database: We don't make any MySQL changes on the databases so your databases are safe.
- MySQL version: currently installed from cPanel is left without any changes.
- User Home Files: nothing is touched except for migration of emails to /var/vmail folder.
- Cronjobs are kept the same.
** It's always smart to have account backups before starting with the major changes.

Imported data
- User accounts, domains, subdomains, parked domains
- Email accounts-mailboxes, forwarders-aliases, autoresponders-autoreply, alias pipe to script
- Resellers
- Hosting packages
- FTP accounts
- SSL Certificates
- Hostname SSL Certificates for (cwp, mail, ftp, webservers)
- All PHP versions (5.3 - 7.3) and we have added handlers of cPanel

Not Imported
- Postgres databases

Required:
- /var/vmail will be the new location for your emails so make sure /var partition has the required size or you can symlink it to /home/vmail

FAQ
- How long this conversion takes: from 10min to 4h depends on the data and server performances
- You should first remove CloudLinux (if you have it) before starting with step 1.

Migration Instructions

Download migration scripts

wget dl1.centos-webpanel.com/files/s_scripts/el7/cpanel-converter/1-cpanel-data-export.sh

wget dl1.centos-webpanel.com/files/s_scripts/el7/cpanel-converter/2-cpanel-uninstall.sh

wget http://centos-webpanel.com/cwp-el7-latest

wget dl1.centos-webpanel.com/files/s_scripts/el7/cpanel-converter/4-import-into-cwp.sh

wget dl1.centos-webpanel.com/files/s_scripts/el7/cpanel-converter/5-mail-sni.sh

Now run the first script
** If you have CloudLinux make sure it was removed before

sh 1-cpanel-data-export.sh

** Check that all data is listed there before proceeding to the next steep

Uninstall cPanel (This can take long time)

sh 2-cpanel-uninstall.sh

Install CWP (CentOS 7)
Default installer, bellow you have optional instructions

sh cwp-el7-latest

Optional arguments for installer

–phpfpm [5.3|5.4|5.5|5.6|7.0|7.1|7.2|7.3] (you can use only one)
–softaculous yes (install softaculous – script installer)

Available short name arguments
-p [5.3|5.4|5.5|5.6|7.0|7.1|7.2|7.3] (you can use only one)
-s yes (install softaculous – script installer)

Example for centos 7 (you can combine short and long name arguments)

sh cwp-el7-latest --phpfpm 7.2 --softaculous yes

Import all exported data into CWP

sh 4-import-into-cwp.sh

Generate Mail Certificates Postfix/Dovecot

sh 5-mail-sni.sh

That is it, reboot the server and you are ready!

OTHER NOTES & SUPPORT
This tool is provided at no cost and without warranty.

If you need to migrate CentOS 6 it's recommended first to migrate all accounts on another cpanel server with CentOS7 and then convert CentOS7 to CWP7.

In case some of your clients don't get satisfied you can make a cpanel backup without the homedir for all users before starting cpanel removal so they can easily return to cpanel.

for i in `cat /etc/trueuserdomains |awk -F: {'print $2'}`;do /scripts/pkgacct --skiphomedir $i /home;done

CloudLinux Uninstall
https://docs.cloudlinux.com/cloudlinux_installation/#uninstalling

Rebuild Named/Bind conf
In most cases you will need to rebuild /etc/named.conf file, we have an API here:
wiki.centos-webpanel.com/cwp-admin-api

ISSUES: MAIL MIGRATION (Optional)
In case of failed migration of emails you can run this command

for i in `find /home/*/mail/* -type d -maxdepth 0 -name "*.*"`;do mv $i /var/vmail/;done

** After that make sure you do API command to fix mail permissions