How-to: cPanel to DA migration


As far as FTP accounts I can't remember I converted like 2 years ago.

Maybe @smtalk will know.

Owner was talking to sales to end up at the license we have, know we have a lot more than 10 accounts / 50 domains on the cPanel side, but I don't have insight as to what plan we're on.

Did additional FTP accounts get imported for yourself? Wondering if the FTP thing is a feature or a bug, 'cause we're holding off with the one customer, but if "it is known" they don't cross the cPanel/DirectAdmin barrier, I can push the customer and let them do the password resets.
 
There were 2-3 per user account which do not exist in DirectAdmin
Are you saying some user accounts were brought over or no user accounts?

Best I remember all the user ftp accounts were brought over. Not the "special ones". DA handles admin ftp accounts different ad has those by default.
Did additional FTP accounts get imported
You mean user ftp accounts in cpanel these are just labeled "Ftp Accounts"
 
Are you saying some user accounts were brought over or no user accounts?

Best I remember all the user ftp accounts were brought over. Not the "special ones". DA handles admin ftp accounts different ad has those by default.

You mean user ftp accounts in cpanel these are just labeled "Ftp Accounts"

Users on the cPanel side have the "special"(default) FTP accounts tied to their username, and additional FTP accounts (guest, editor@, etc) they created themselves.

After restore on DirectAdmin side, only 1 FTP Account per user was created (their username with access to /home/username). all the additional FTP accounts per user are missing.
 
Users on the cPanel side have the "special"(default) FTP accounts tied to their username, and additional FTP accounts (guest, editor@, etc) they created themselves.

After restore on DirectAdmin side, only 1 FTP Account per user was created (their username with access to /home/username). all the additional FTP accounts per user are missing.
If there is no support included with your license - please PM me any cpmove backup file which had this issue (you may create a new one, without any data, if you wish). I'd like to check why FTP accounts didn't get migrated there.
 
If there is no support included with your license - please PM me any cpmove backup file which had this issue (you may create a new one, without any data, if you wish). I'd like to check why FTP accounts didn't get migrated there.

Thanks, after some figuring, I was able to create a ticket in the end. The mistake was trying to create the ticket with our ID + the license ID, instead of our ID + our pass.

If you have access, ticket #31750 - the x4 cpmove tgz's are on the server and the ticket has admin details to access it.
 
Hello Martynas,
Thank you for the excellent conversion script.

We are in the process of migrating a dedicated server with 200 cPanel accounts and noticed a problem with the subdomain document roots. The conversion logic appears to work and the files are placed in the right location, but the configuration filename is wrong: It is currently creating subdomain.docroot.override, which is ignored by the restore process because directadmin is looking for domain.subdomains.docroot.override.

The diff below appears to fix the problem.

DirectAdmin version: 1.61.5
cpanel_to_da version: 0.0.48

Diff:
--- cpanel_to_da.sh     2021-03-03 09:29:46.410999720 +0100
+++ cpanel_to_da.sh.new 2021-03-03 09:29:19.843474636 +0100
@@ -576,7 +576,7 @@ subjectAltName=${SAN_NAMES}" > ${DIRECTA
        
        #Create subdomains.list and make sure subdomain path is correct
        CONVERTED_DOMAIN_SUBDOMAINS="${DIRECTADMIN_BACKUPS}/${USERNAME}/backup/${CONVERTED_DOMAIN}/subdomain.list"
-       CONVERTED_DOMAIN_SUBDOMAINS_SDOCROOTS="${DIRECTADMIN_BACKUPS}/${USERNAME}/backup/${CONVERTED_DOMAIN}/subdomain.docroot.override"
+       CONVERTED_DOMAIN_SUBDOMAINS_SDOCROOTS="${DIRECTADMIN_BACKUPS}/${USERNAME}/backup/${CONVERTED_DOMAIN}/domain.subdomains.docroot.override"
        echo -n '' > ${CONVERTED_DOMAIN_SUBDOMAINS}
        for i in `cat ${DIRECTADMIN_BACKUPS}/${USERNAME}_cpanel_to_convert/sds | grep ${CONVERTED_DOMAIN}`; do {
                if grep -m1 -q "=${i}$" ${DIRECTADMIN_BACKUPS}/${USERNAME}_cpanel_to_convert/addons; then
 
you guys recommend doing this in the same server? i have a cpanel with 300 users, need to migrate to directadmin very soon. what you recommend? can i install directadmin in the same server?
 
hi im trying to migrate packages from cpanel to my new DA server with this command


/usr/local/directadmin/scripts/cpanel_to_da/copy_root_packages.sh panel.hostname.net 26070
Enter SSH password of panel.dbspma.net, if ssh-key is setup - just leave it empty: ssh: connect to host panel.hostname.net port 26070: Connection refused

what im doing wrong? im entering the correct password, im missing something?

thank you
 
When we move this users, then the mail client automatically download again all the messages from the server Is any way to bypass this? and after the restore the emails have the same uid so the mail client download only the new messages?But one of the key items I came up with... and maybe this won't work from a DirectAdmin point of view why are we relying on the DCV challenge information being within the user's control?
 
Hello,

Problem after restoration CPanel to DirectAdmin, I have this error if I try to create a domain name pointer on a domain that has just been restored on DA, on the other hand if I create another domain name and add a 'domain pointers', it is functional, it's only on domain names that are imported from CPanel, someone has a solution to this problem too? I know that's a lot...
Exemple: mydog.com has been migrate CPanel to DA, but if add mycat.com as 'domain pointers', I have this error :

UNABLE TO ADD DOMAIN POINTER​


Could not write domain's db file in /var/named
Unable to save dns zone: named-checkzone returned:
loading "mycat.com" from "/var/named/mycat.com.db.temp.9292.AJaGISR8GP" class "IN"
dns_master_load: /var/named/mycat.com.db.temp.9292.AJaGISR8GP:35: mail.mycat.com: CNAME and other data
dns_master_load: /var/named/mycat.com.db.temp.9292.AJaGISR8GP:36: www.mycat.com: CNAME and other data
zone mycat.com/IN: loading from master file /var/named/mycat.com.db.temp.9292.AJaGISR8GP failed: CNAME and other data
zone mycat.com/IN: not loaded due to errors.

P.S.: I want to clarify that I only have this error on accounts that have been migrated with the migration script.

In the meantime, tomorrow, I will try via jetbackup the restorations to see if it changes anything.
Thank you x2!
 
Last edited:
Ok, To continue my previous post,
After several, several tests, there seems to be a bug with this migration script on my side.
It is at the level of the restoration of the main domain name that the concern lies, if someone could reproduce this sequence in order to achieve the same result:
- copy of the cpmove file in the all_backups folder of the user 'admin'
- execution of the assignment of rights in the case where: chown -R admin. /home/admin/all_backups
- we restore the CPanel backup file via the directadmin interface "Admin Backup / Transfer" section. (all is well so far)
- the problem starts when we want to add an alias on the main domain name (we connect in the user panel)
- we click on 'domain pointers' then on 'create domain pointers'
- We give a name 'anything.com' and we press 'create' and boom we have an error 'impossible to create the corresponding dns zone' ... And if at this stage we restart the named service, it does not restart not because it cannot find the dns zone of the previously aliased domain name.

So I tried something else, in this same account (once restored via a CPanel backup), I simply deleted the main domain but without deleting the data files, then I recreated the same domain name .
I then did the same steps to create an alias and there I no longer have an error.

So there is a 'bug' on the creation of the primary domain during the initial restore of the CPanel backup file.

I also tested the restoration of an account on which there were several aliases on the domain name in the CPanel and well all the aliases are not restored and that created the same problem as explained above.

Does anyone have the same concerns as me?

Could the creators of this migration script help me?

Thanks, because I can't see myself deleting the princiapl domain every time to re-create it every time, moreover, it might not delete the data from the website, but the e-mail addresses yes ... So nor is it an alternative solution for a migration from CPanel to DirectAdmin.

Thank you!
 
Great I found the solution !!!! It seems that the DNS zone coming from CPanel does not please DA (the CNAME zones) !!!
I had to click on 'reset default' on the DNS zone of the main domain of the restored account and now I can add an alias on the main domain of the migrated account from CPanel!
Weird isn't it?
 
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 ?
 
Back
Top