This tutorial will show you how to migrate all of your accounts from a cPanel server to a DirectAdmin server and restore them all at once, or how to transfer 1 cPanel backup file and restore it on the DirectAdmin server. This tutorial is advanced and assumes you have knowledge on how to use SSH + root access to your VPS or server
Before doing anything, you want to login to your DirectAdmin VPS/server and make sure you’re using the latest version of CustomBuild so that the cPanel conversion scripts are updated
cd /usr/local/directadmin/custombuild
./build update
./build cpanel_to_da
- Log into your cPanel server via SSH and root. Then, run the following script to automatically generate cPanel account backups of all of your accounts on the cPanel server. You will want to do this in a “screen” session in case you lose connectivity and do not want to have to start over
screen
mkdir -p /home/all_backups
for user in `ls /var/cpanel/users/`; do { /scripts/pkgacct ${user} /home/all_backups; }; done
You can now close your putty screen and check on it by running “screen -r” when you log back in.
After you see all of the backups have been generated, you will now need to transfer them from the cPanel server to your new DirectAdmin server. We do this via the rsync command
rsync -avt –delete /home/all_backups/ root@your_directadmin_server.com:/home/admin/all_backups/
Once the cPanel backup files have been transferred over to the DirectAdmin server, you can log into your DirectAdmin servers control panel.
Now we can simply go to DirectAdmin “Admin Backup/Transfer” section, check “Backup/Restore Settings” (defaults should be fine) in Admin level and restore all backups from “/home/admin/all_backups” directory.
This will now restore everything and when the accounts are done restoring you’ll be able to check your DirectAdmin admin messages and see that it’s been completed.
EXTRA NOTES:
Create A Hostname SSL
After you’ve pointed your primary domain to the DirectAdmin server, you’ll want to generate a SSL certificate for your servers hostname so you don’t keep getting browser warnings when trying to log into your server
cd /usr/local/directadmin/scripts
./letsencrypt.sh request_single HOSTNAME.REPLACE.COM 4096 systemctl restart directadmin
After doing this, you’ll be able to access DirectAdmin via https://your.hostname.com:2222
Retrieving your DirectAdmin License and updating it:
If you need to retrieve the license key for your DirectAdmin, run this (replace CLIENTID with your DirectAdmin ClientID and the LICENSENUMBER with your DA license number):
cd /usr/local/directadmin/scripts
./getLicense.sh CLIENTID LICENSEIDNUMBER!
service directadmin restart
Swap DirectAdmin IP out with a new one
Lets say you were replacing the DirectAdmin VPS IP with the IP of your old cPanel server. You’ll need to swap the IP’s:
cd /usr/local/directadmin/scripts
./ipswap.sh OLDIP NEWIP
systemctl restart exim
systemctl restart dovecot
systemctl restart named
systemctl restart httpd
systemctl restart directadmin