How-to: cPanel to DA migration

Hi all,

This solution was not documented anywhere, i may not be the only one that loves a clean zone file (without yucky cPanel records that are no longer needed).

If anyone wants to get rid of the "old" cPanel records once you've migrated over:

#!/bin/sh for user in `cat /usr/local/directadmin/data/users/*/users.list`; do { for DOMAIN_TO_USE in `grep ": ${user}$" /etc/virtual/domainowners | cut -d: -f1`; do { echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=cpanel" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=cpcalendars" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=cpcontacts" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=webdisk" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=whm" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=cpanel" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=cpcalendars" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=cpcontacts" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=webdisk" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=whm" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=TXT&name=_cpanel-dcv-test-record" >> /usr/local/directadmin/data/task.queue /usr/local/directadmin/dataskq } done } done

And cPanel also does add the webmail subdomain, you could remove that one too but it might be nice to keep that one if you have a webmail subdomain enabled on DirectAdmin.

@DirectAdmin Support @smtalk any ideas to make this better, or maybe that we could even check subdomains that have these records?

Happy days! :cool: 🎉🥳
 
Last edited:
I
Hi all,

This solution was not documented anywhere, i may not be the only one that loves a clean zone file (without yucky cPanel records that are no longer needed).

If anyone wants to get rid of the "old" cPanel records once you've migrated over:

#!/bin/sh for user in `cat /usr/local/directadmin/data/users/*/users.list`; do { for DOMAIN_TO_USE in `grep ": ${user}$" /etc/virtual/domainowners | cut -d: -f1`; do { echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=cpanel" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=cpcalendars" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=cpcontacts" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=webdisk" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=A&name=whm" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=cpanel" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=cpcalendars" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=cpcontacts" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=webdisk" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=AAAA&name=whm" >> /usr/local/directadmin/data/task.queue echo "action=dns&do=delete&domain=${DOMAIN_TO_USE}&type=TXT&name=_cpanel-dcv-test-record" >> /usr/local/directadmin/data/task.queue /usr/local/directadmin/dataskq } done } done

And cPanel also does add the webmail subdomain, you could remove that one too but it might be nice to keep that one if you have a webmail subdomain enabled on DirectAdmin.

@DirectAdmin Support @smtalk any ideas to make this better, or maybe that we could even check subdomains that have these records?

Happy days! :cool: 🎉🥳

So I just use this script as is ?
 
I'm having a hard time transfering from cPanel to DirectAdmin. Receiving an error (see below) during the restore. Everything seems to work fine, but all the e-mail accounts are EMPTY. They are being created so that's not an issue, they're just empty. Not really sure what to do now? Any help would be appreciated. We're using OpenLiteSpeed, not Apache which might cause the 'Invalid path' error.

Code:
E-Mail: Unable to add forwarder *
Catch all is now set to :fail:

Ftp: Invalid path: /etc/apache2/logs/domlogs/museum: belowHomePath:museum: /etc/apache2/logs/domlogs/museum does not start with /home/museum
 
I'm having a hard time transfering from cPanel to DirectAdmin. Receiving an error (see below) during the restore. Everything seems to work fine, but all the e-mail accounts are EMPTY. They are being created so that's not an issue, they're just empty. Not really sure what to do now? Any help would be appreciated. We're using OpenLiteSpeed, not Apache which might cause the 'Invalid path' error.

Code:
E-Mail: Unable to add forwarder *
Catch all is now set to :fail:

Ftp: Invalid path: /etc/apache2/logs/domlogs/museum: belowHomePath:museum: /etc/apache2/logs/domlogs/museum does not start with /home/museum

Make sure your cPanel and DirectAdmin have the same MySQL/MariaDB version.

I had also faced similar issue. Maybe this can be helpful for you.
 
This script works well - its just subdomains that is an issue still at times. Nevertheless that's the only issue we noticed with some customers.
 
I have lost my Panel due to login attempts , how can i restore it please?

Which link should i use
 
SSH into your server, remove your IP from

Code:
/usr/local/directadmin/data/admin/ip_blacklist

and restart directadmin
 
I have a few CPanel accounts from my reseller to migrate to my DA server.

Will the cadval / address book move over? Also does email autoconfig work ?
 
Hello
I am using cpanel with 300 acc now i want to change panel from cpanel to DA what should i do
I don't have extra server i have to use same server just want to change panel and space is also not available like might be i will have 200GB available but account storages are more than 800GB

Any suggestions please
 
i try to install the conversion script but on last custombuild version it seems to be remove

./build cpanel_to_da

not work and give the list of all build commands.
DA version 1.642
CB version 2.0.0 (rev: 2939)

How can i fix it?
 
Im trying to import a cpanel backup and its giving an error but cant figure out how to fix the issue...
Can someone please help me with this?
I renamed the full backup file to cpmove-username
Here is the error log:

Code:
Unable to create DirectAdmin backup /home/admin/admin_backups/user.gdresell.ilmxjit57bta.tar.zst. Exiting...

Error converting file: /home/admin/admin_backups/cpmove-ilmxjit57bta.tar.gz: Converting ilmxjit57bta (/home/admin/admin_backups/cpmove-ilmxjit57bta.tar.gz)...
Found previous /home/admin/admin_backups/ilmxjit57bta. Removing...
Adding domain aliases...
Converting dadshideout.com domain...
writing RSA key
AWSTATS: moving awstats data
Copying email aliases...
Generating roundcube.xml...
Generating /home/admin/admin_backups/ilmxjit57bta/backup/dadshideout.com/email/data/roundcube.xml...
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving email data of [email protected]
Moving squirrelmail data
Moving default domain dadshideout.com data...
Moving main email account...
Removing symlinks from main email account and home folder:
/home/admin/admin_backups/ilmxjit57bta_cpanel_to_convert/homedir/www
Renaming .trash to .trash.cpanel
Creating database user ilmxjit57bta for database dadshide_forum...
Creating database user ilmxjit57bta for database dadshide_forum...
Creating database user ilmxjit57bta for database dadshide_forum...
Creating database user ilmxjit57bta for database dadshide_forum...
Creating database user ilmxjit57bta for database dadshide_forum...
Creating database user ilmxjit57bta for database dadshide_forum...
Moving database dadshide_forum files...
Creating database user ilmxjit57bta_ips for database dadshide_IPS...
Creating database user ilmxjit57bta for database dadshide_IPS...
Creating database user ilmxjit57bta_ips for database dadshide_IPS...
Creating database user ilmxjit57bta for database dadshide_IPS...
Creating database user ilmxjit57bta_ips for database dadshide_IPS...
Creating database user ilmxjit57bta for database dadshide_IPS...
Creating database user ilmxjit57bta for database dadshide_IPS...
Creating database user ilmxjit57bta for database dadshide_IPS...
Creating database user ilmxjit57bta for database dadshide_IPS...
Creating database user ilmxjit57bta for database dadshide_IPS...
Creating database user ilmxjit57bta for database dadshide_IPS...
Creating database user ilmxjit57bta for database dadshide_IPS...
Moving database dadshide_IPS files...
Creating DirectAdmin tarball...

File '/home/admin/admin_backups/cpmove-ilmxjit57bta.tar.gz' has not been restored
 
Back
Top