Migrate Accounts from cPanel to DirectAdmin
Posted on July 11th, 2020
cPanel is one of the most common and widely used control panels. But cPanel has recently announced a massive increase in their pricing scheme. This increase in the price schema has impacted so many customers and businesses. So, customers are now migrating their cPanel sites to other control panels, and some of them are migrating their cPanel sites to DirectAdmin.
DirectAdmin provides three levels of access, such as admin, user, and reseller, and is a web hosting control panel. DirectAdmin also offers both graphical and web-based interfaces. You can control an unlimited number of websites and email accounts using a DirectAdmin panel. The DirectAdmin panel does not provide all the features as same as that of cPanel, but it does provide equal user satisfaction as that of cPanel. You can purchase the DirectAdmin license from the InterServer client portal. DirectAdmin offers many administrator features, such as DNS Administration, IP Manager, Create/Modify Admins and Resellers, Mail Queue Administration, and more. To know more about the DirectAdmin features, please visit the DirectAdmin official website here: https://www.directadmin.com/features_list.php.
To install the DirectAdmin control panel on your server, follow the steps and tips on the tutorial topic “DirectAdmin Installation”: https://www.interserver.net/tips/kb/directadmin-installation/.
In this tutorial, you learn the steps to migrate your website accounts from cPanel to DirectAdmin. Please note that you should have a DirectAdmin version 1.57.3 or higher to migrate the cPanel accounts to DirectAdmin.
Migrate Accounts from cPanel to DirectAdmin
To migrate the cPanel accounts to DirectAdmin, follow the below steps:
First, log in to your cPanel account as a root user via SSH.
Then, run the following script to generate a full cPanel account password. Please note that the generated backup should be in the ‘cpmove-user.tar.gz’ format. The /scripts/pkgacct script packages all the accounts in a cPanel. Replace the <username> flag with the username of the cPanel account.
# /scripts/pkgacct <username> /home/user_backups;
After generating a backup, Log in to the DirectAdmin server as a root user.
Run the following command to sync the cPanel backup to the DirectAdmin server.
# rsync -avt /home/user_backups/ root@<your_directadmin_server>.com:/home/admin/converted_user_backup/
Check the DirectAdmin version by running the following command.
# /usr/local/directadmin/directadmin c | grep -i 'version='
Go to the ‘custombuild’ directory by running the following command.
# cd /usr/local/directadmin/custombuild
Next, update the build script by using the following command.
# ./build update
Then, install the cpanel_to_da plugin using the build script.
# ./build cpanel_to_da
Change the user and group ownership of the user backup file to admin by running the following command.
# chown -R admin. /home/admin/converted_user_backup
If your cPanel account username has a name length more than 8, then run the following command to increase the name length on the DirectAdmin server also by running the following command. In the following command, the value ‘16’ represents that the name length should set to 16 on the DirectAdmin server.
# /usr/local/directadmin/directadmin set max_username_length 16 restart
Now, log in to the DirectAdmin front-end by hitting the following URL in any of the browsers.
https://<Server_IP_Address>:2222 or https://<Server_domain_name>:2222
Go to the ‘Admin Tools’ tab and select the ‘Admin Backup/Transfer’ option, as shown in the following screenshot.
You get redirected to the Admin Backups page, and from there to restore the backup in your server, click the ‘RESTORE’ button.
Next, change the path in the ‘Restore Backup’ page from undefined to the path of the backup in the server (/home/admin/converted_user_backup). Then only the backup gets displayed, and after that, click the ‘NEXT STEP’button.
Replace the IP address with the server IP and click the ‘NEXT STEP’ button.
In the Next Step, you can select the cPanel backup that needs to get restored from the list of cPanel backups. Select the files that need to be restored and click the ‘RESTORE’ button.
Now, the backup restoration gets initiated. This process of backup restoration gets added to the queue.
After the restoration completes, it displays a message with the subject ‘Your User files have been restored’ in the ‘My messages’ page.
Fix Common Migration Related Errors.
After the migration completes, some customers may face some issues due to migration. Some of the common migration-related errors are:
- Version Compatibility Issue
- Incorrect Permission and Ownership
To fix these common migration-related issues, do the following:
1) Version Compatibility Issue:
To smoothly migrate the accounts, the version of all the software running in both source and destination server should match. If there is any software version compatibility, then the website or account won’t work as the same as that of the source server. For example, sometimes, a user can get a blank page for their website after the migration. In this case, the chance is that the PHP version of the destination is not compatible with the website content, or there is a mismatch in the extensions or software version. So, we can check the version of the software or extension in the source server and replace the destination software or extension version as same as that of the source server. This process can fix the version compatibility issue after the migration.
2) Incorrect Permission and Ownership
After the migration, the website may throw some error due to incorrect permissions and ownership of the files/directories in the destination. So, after migrating the site, we should make sure that the files and directory permission are 644 and 755, respectively. During the migration, we change the ownership of all the files to admin, but even after the migration, if there is any mismatch, then we can change the files or directory ownership to fix that error.
If you need any further help, please do reach our support department.