Are you trying to manually migrate accounts to cPanel/WHM?
This guide will help you.
It is possible to migrate accounts from unsupported third-party control panels to cPanel & WHM with some customization of unsupported services to use them on cPanel & WHM.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform Server and Website Migration Tasks.
In this context, we shall look into how to manually migrate accounts to cPanel/WHM.
To migrate accounts to cPanel, follow the steps given below:
Decrease DNS records Time To Live (TTL) on all of the account’s domains.
It is better to perform these steps a few days before we begin the migration process.
During the installation process, we must select a hostname and main IP address for the new server. The system uses these settings to configure the DNS zone files for restored accounts.
After the creation of the new cPanel & WHM account, we can migrate the old server's files and directories to the appropriate locations on the new server.
1. Firstly, backup everything on the server, found in the control/admin area.
2. Then download all files and directories, maintaining the exact same structure.
3. After that we can backup all databases associated with the sites.
4. Once we complete backing up, we can download it.
5. After that log in to the cPanel account that we are moving to and go to cPanel’s File Manager or connect via FTP.
6. Upload the directories and files to the public_html folder.
7. From the MySQL Database Wizard we can create a new database and user.
8. Note the username and password.
9. Assign the user to the database and assign All Privileges.
10. After that, Import the database from PHPMyAdmin.
11. Take the wp-config and edit db_name, db_user, db_password, and db_host.
12. Finally, if the site is working correctly, we can change nameservers with the domain registrar to the domain nameservers provided.
13.We must wait 48 hours before canceling the old hosting and before doing so ensure that the site is loading correctly from our new hosting.
Following are some of the files and directories which we will be copying while migrating the accounts.
The cPanel & WHM supports Apache, BIND, Exim, and Mailman.
The public_html directory contains all of the files, directories, subdirectories, and content. In other words, this directory may appear as the /home/user/www directory or the /home/user/vhost directory depending upon the system.
The user must own the files and subdirectories in this directory.
And subdirectories in this directory must possess 755 permissions and files in this directories must possess 644 permissions.
We can see this from the following example:
drwxr-x--- 7 user nobody 4096 Jan 11 08:35 ./
drwx--x--x 41 user user 4096 Mar 14 02:18 ../
drwxr-xr-x 2 user user 4096 May 20 2014 cgi-bin/
drwxr-xr-x 2 user user 4096 Sep 4 2014 entropybanner/
-rw-r--r-- 1 user user 2 Jan 11 08:35 example.html
drwxr-xr-x 2 user user 4096 Jul 16 2013 scgi-bin/
All of the email files for all of the cPanel account’s email accounts will be available in /home/user/mail directory contains
Moreover, it includes email accounts for any addon domains, parked domains, and subdomains.
Users who migrate data to cPanel & WHM servers must convert any mbox data to the Maildir format.
We can see this from the following example:
<drwxr-x--x 9 user user 4096 Jun 8 2015 ./
drwxr-x--x 3 user user 4096 Apr 28 2014 ../
-rw-rw---- 1 user user 43 Apr 30 2014 courierimapacl
drwxr-x--x 2 user user 4096 Apr 28 2014 cur/
drwxr-x--x 5 user user 4096 Apr 28 2014 .Drafts/
drwxr-x--x 5 user user 4096 Apr 28 2014 .Junk/
-rw-r----- 1 user mail 18 Jun 30 2014 maildirsize
drwxr-x--x 2 user user 4096 Apr 28 2014 new/
drwxr-x--x 5 user user 4096 Apr 28 2014 .Sent/
drwxr-x--x 2 user user 4096 Apr 30 2014 tmp/
drwxr-x--x 5 user user 4096 Apr 28 2014 .Trash/
The /home/user/tmp directory contains the account’s temporary files and bandwidth and statistics data.
For example, we can migrate our original server’s AWStats data to the /home/user/tmp/awstats directory:
drwxr-xr-x 11 user user 4096 Mar 2 12:26 ./
drwx--x--x 41 user user 4096 Mar 14 02:18 ../
drwxr-xr-x 3 user user 4096 Apr 18 2015 analog/
drwxr-xr-x 3 user user 4096 Apr 18 2015 awstats/
drwxr-xr-x 2 user user 4096 Sep 6 2013 cpbandwidth/
drwx------ 2 user user 4096 May 12 2014 cpcsvimport/
drwx------ 2 user user 4096 Jun 9 2015 horde/
drwxr-xr-x 2 user user 4096 Oct 22 2014 logaholic/
drwxr-xr-x 3 user user 4096 Oct 30 2014 pear/
drwxr-xr-x 3 user user 4096 Apr 18 2015 webalizer/
drwxr-xr-x 2 user user 4096 Oct 22 2014 webalizerftp/
The /home/user/etc directory contains the email account password, shadow and quota files for email accounts.
For example, we can migrate our original server's email account quota data to the /home/user/etc/quota directory:
drwxr-x--- 5 user mail 4096 Oct 21 10:23 ./
drwx--x--x 41 user user 4096 Mar 14 02:18 ../
drwx--x--x 3 user user 4096 Apr 22 2014 passwd/
-rw-r--r-- 1 user user 0 Apr 22 2014 quota
-rw-r--r-- 1 user user 9 Feb 4 09:33 cacheid
drwxr-x--- 5 user user 4096 Mar 12 03:11 shadow/
The /home/user/ssl directory contains the SSL certificates for the domains on the account.
After migrating the SSL certificates, we must activate them in the Manage SSL Hosts section of WHM's Manage SSL Hosts interface (WHM >> Home >> SSL/TLS >> Manage SSL Hosts):
drwxr-xr-x 5 user user 4096 Aug 3 2015 ./
drwx--x--x 41 user user 4096 Mar 14 02:18 ../
drwx------ 2 user user 4096 Feb 16 2015 certs/
drwx------ 2 user user 4096 Feb 16 2015 csrs/
drwx------ 2 user user 4096 Mar 25 2015 keys/
The MySQL directory stores the MySQL databases for every account on the server.
We must create the empty database on the account first and then restore it to that new database:
drwxr-x--x 30 mysql mysql 4096 Mar 14 02:57 ./
drwxr-xr-x 26 root root 4096 Nov 11 03:11 ../
drwx------ 2 mysql mysql 4096 Jun 17 2014 apitest_hammock_r_d/
drwx------ 2 mysql mysql 4096 Jun 17 2014 apitest_jason/
drwx------ 2 mysql mysql 4096 Jun 17 2014 apitest_newestaddition/
-rw-rw---- 1 mysql mysql 16384 Feb 20 03:07 aria_log.00000001
-rw-rw---- 1 mysql mysql 52 Feb 20 03:07 aria_log_control
-rw-rw---- 1 mysql mysql 56 Feb 11 2015 auto.cnf
The /var/lib/pgsql directory stores the PostgreSQL databases for every account on the server:
drwxr-x--x 30 pgsql pgsql 4096 Mar 14 02:57 ./
drwxr-xr-x 26 root root 4096 Nov 11 03:11 ../
drwx------ 2 pgsql pgsql 4096 Jun 17 2014 apitest_hammock_r_d/
drwx------ 2 pgsql pgsql 4096 Jun 17 2014 apitest_jason/
drwx------ 2 pgsql pgsql 4096 Jun 17 2014 apitest_newestaddition/
-rw-rw---- 1 pgsql pgsql 16384 Feb 20 03:07 aria_log.00000001
-rw-rw---- 1 pgsql pgsql 52 Feb 20 03:07 aria_log_control
-rw-rw---- 1 pgsql pgsql 56 Feb 11 2015 auto.cnf
Now let's see how our Support Experts fix the common errors faced while migrating.
Usually, we end up experiencing website errors after migrating from an old server to a new server.
Mainly, this may happen due to incorrect permission and ownership of directories or files that set up in the destination server.
To fix this we have to ensure that file permission and ownership are correctly given.
We can check this using the commands given below:
find /home/<cpuser>/public_html/ -type f -exec chmod 644 {} \;
find /home/<cpuser>/public_html/* -type d -exec chmod 755 {} \;
Similarly, while migrating large mailboxes customers we can face problems like timeout errors. By default, imapsync often causes timeouts when the migration process continues for a longer period.
To avoid these timeout errors, we can switch off the computation of statistics using the following command:
--nofoldersizes --skipsize --fast
This article covers how to manually #migrate accounts to cPanel/WHM, as well as the steps to fix common errors faced while migrating.
After you migrate your files to your new cPanel & WHM server, perform the following steps:
1. Confirm that all of the content and credentials migrated properly and that they function in the new environment.
2. Update your domain's nameservers to match the new nameservers on your cPanel & WHM server.
3. Create cPanel and reseller accounts. To do this, use WHM's Create a New Account interface (WHM >> Home >> Account Functions >> Create a New Account).
After you create the new #cPanel & #WHM account, migrate the old server’s files and directories to the appropriate locations on your new server.
Generally, you will migrate the following files and directories during this process:
1. The public_html directory contains all of your files, directories, subdirectories, and content. This directory may appear as the /home/user/www directory or the /home/user/vhost directory on some systems.
2. The /home/user/mail directory contains all of the email files for all of the cPanel account’s email accounts.
3. The /home/user/tmp directory contains the account’s temporary files and bandwidth and statistics data. For example, you can migrate your original server's AWStats data to the /home/user/tmp/awstats directory.
4. The /home/user/etc directory contains the email account password, shadow, and quota files for email accounts. For example, you can migrate your original server’s email account quota data to the /home/user/etc/quota directory.
5. The /home/user/ssl directory contains the SSL certificates for the domains on the account.
6. The mysql directory stores the MySQL databases for every account on the server.
7. The /var/lib/pgsql directory stores the PostgreSQL databases for every account on the server.