Feture request, cpanel backup to directadmin backup.

dalet11

Verified User
Joined
Apr 29, 2010
Messages
5
hey,
i'm sure this feture will be relevent for lots of us..
cpanel have a transfer tool, allow to transfer clients from da.cpanel,plesk etc to the cpanel with a click of a button.

it will be very useful if we will have at least the option to restore an cpanel backup on directadmin, lots of time clients ask me for help to transfer there websites from cpanel hosting, and i need to do that manualy today..
 

MMarko

Verified User
Joined
May 10, 2006
Messages
52
Location
eu
Yes, would be great to have officialy supported migration tool for cPanel backups.
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,340
Location
LT, EU
cPanel backup conversion tool is now ready :) I'm attaching it to the reply.

Guide for whole-server migration or single-account (2nd post in the thread) : https://forum.directadmin.com/showthread.php?t=58059&p=296438#post296438

Differences between this tool and the one that is already on DA forums:
1. Script transfers resellers and their packages.
2. Script transfers subdomain/domain data from custom folders.
3. Email forwarders get transferred.
4. MX records in DNS zones get transferred.
5. RoundCube data gets transferred (optional, requires additional scripts)

There might be more differences between the scripts, but these are the most obvious ones :)

Known issues:
* cPanel mdbox format email transfer has not been tested
* Mailman mailing lists do not get converted to majordomo mailing lists

Please let us know if you notice anything with your transfers :)

Cpanel to DA backup conversion script URL http://www.custombuild.eu/cpanel/cpanel_to_da.sh

It will not convert RoundCube data by default, please do the following in the same directory if you want RoundCube data to be transferred:
Code:
wget -O cpanel_da_roundcube.php http://www.custombuild.eu/cpanel/cpanel_da_roundcube.php.txt
wget -O php_sql_parser.tar.gz http://www.custombuild.eu/cpanel/php_sql_parser.tar.gz
tar xzf php_sql_parser.tar.gz
rm -f php_sql_parser.tar.gz
 
Last edited:

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,340
Location
LT, EU
Updated to version 0.0.2:
* Autoresponders are transferred now
* /home/user data in main folder is also transferred (including .softaculous and other files)
 

modem

Verified User
Joined
Apr 7, 2004
Messages
383
Hello,

I downloaded your tool and ran into some problems. I have a 1.8GB backup file from someone on cPanel and they want it converted/imported into a DA account. When I run download your script, I make sure it's chmod'd to executable and then I run it as root and do the following command: ./cpanel_to_da.sh /<location>/backup-7.22.2017....tar.gz /home/<account>/backups

I get the following error: you gave #2 ./cpanel_to_da.sh /<location>/backup-7.22.2017....tar.gz /home/<account>/backups

Any help would be greatly appreciated!
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,340
Location
LT, EU
Please try re-downloading the script and let me know if that helps :)
 

modem

Verified User
Joined
Apr 7, 2004
Messages
383
Please try re-downloading the script and let me know if that helps :)
I did, however today I received the message:

Max username length (10) is smaller than cPanel username (12)

So I deleted the user account on my DA server (no data imported yet) and recreated it using the max amount of characters that DA allows for usernames (10). I reran the conversion tool but I still received the above error. I did notice that the original cpanel username is 12 characters. Advice on how to work around this?

Thanks!
 

ditto

Verified User
Joined
Apr 27, 2009
Messages
2,464
I did, however today I received the message:

Max username length (10) is smaller than cPanel username (12)

So I deleted the user account on my DA server (no data imported yet) and recreated it using the max amount of characters that DA allows for usernames (10). I reran the conversion tool but I still received the above error. I did notice that the original cpanel username is 12 characters. Advice on how to work around this?

Thanks!

Edit /usr/local/directadmin/conf/directadmin.conf and add this line:

Code:
max_username_length=12
Then restart DirectAdmin.
 

modem

Verified User
Joined
Apr 7, 2004
Messages
383
Edit /usr/local/directadmin/conf/directadmin.conf and add this line:

Code:
max_username_length=12
Then restart DirectAdmin.
Thanks. That solved the character limit error. However, now when i run the script, i see it trying to extract/convert files, but it gives errors on each one. Here's a sample:

tar: homedir/public_html/wp-content/uploads/<filename>: Cannot open: No such file or directory.

tar: homedir/.htpasswds: Cannot mkdir: Disk quota exceeded.

Just a note, I'm running this as root in my root folder. The end user acct has 10gb of storage available and the tar.gz file is 2.8gb in size. It was ftp'd to my server straight from GoDaddy. Any advice on what might be causing these errors?
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,340
Location
LT, EU
You might have that tar.gz owned by the user on the system, taking 2.8GB + extracted it could take 3-4GB more. Try chowning the tar.gz you're trying to convert to root, or just increase the quota for the user temporary (by the way, you don't need to have the user created in DirectAdmin at all, so you can simply remove it).
 

modem

Verified User
Joined
Apr 7, 2004
Messages
383
Thanks! I'll double check everything. I did have the tar.gz stored in the /root/downloads folder I created where I'm running the script as well. I did have 10gb allocated for the user in their /home/user/backups folder. Are there any location requirements on where the script can or can't be run at?
 

modem

Verified User
Joined
Apr 7, 2004
Messages
383
Just a followup, I chown'd the tar.gz file because it had admin:admin ownership, and made it root:root ownership. I also left it in /root/downloads and created a backup folder in there called /root/downloads/backup. However, when running the script again I receive the following:

tar: homedir/public_html/wp-content/<files...>: Cannot open: No such file or directory

along with at the end of the verbose part of the script:

tar: homedir/.ftpquota: Cannot open: Disk quota exceeded
tar: homedir/.bashrc: Cannot open: Disk quota exceeded
tar: Error exit delayed from previous errors
Failed to extract backup-7.26.2017_07-15-24_(user).tar.gz to /root/downloads/backups/(user)_cpanel_to_convert

I noticed that inside the backups folder, that it creates a folder with <username> as the name. Inside of that it creates two folders "backup" and "domains". However all of these folders are empty, but do have root ownership just like the tar.gz file has. As for the above about disk quote exceeded message, that only happens on several files while the rest show no such file or directory.
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,340
Location
LT, EU
Would it be possible to check it on your server (free of charge, of course)?
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
581
Location
Murfreesboro
The script seems to work well for me. Just some general questions.

Is is it better to use cpmove files or the New cpanel backup files?
Is the roundcube piece going to be added?
If not can you explain how to use it more.
It would be great if the entire process of transferring from cpanel was added to DA
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,340
Location
LT, EU
Is is it better to use cpmove files or the New cpanel backup files?
It's been tested with cpmove files, so I am not sure yet if it works with new cpanel backup files.

Is the roundcube piece going to be added?
Yes, it transfers RoundCube data, but only if you download additional files mentioned in the first post. If you have them in the same folder as the transfer script, then it will automatically add roundcube data to backups.
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
581
Location
Murfreesboro
Thanks it is good work and I appreciate it. I will check it out with the roundcube pieces.
 
Last edited:

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
581
Location
Murfreesboro
Mysql db I see it moves them over. I also got the mysql user. Seems the passwords are wrong. Should the passwords come over and be correct for any DB it migrates?
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,340
Location
LT, EU
It should migrate correct passwords, however, if there is a username mismatch - it might rename your database or database user. For example, if you had username bdacus01 on cpanel and database user bdac_database, then the script will rename it to bdacus01_database, so that it'd be in correct format.
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
581
Location
Murfreesboro
It should migrate correct passwords, however, if there is a username mismatch - it might rename your database or database user. For example, if you had username bdacus01 on cpanel and database user bdac_database, then the script will rename it to bdacus01_database, so that it'd be in correct format.
Ok gotcha. I will check username first.
 
Top