As of version 1.57.4 of DirectAdmin, native conversion and restoration of cPanel user accounts is included using the standard admin backup GUI function found in DirectAdmin.
Conversion Guide
This article contains information about converting cPanel user acounts to the latest available DirectAdmin version.
The provided tool works by converting cPanel user backup files to DirectAdmin user backup files. This tool is designed to read all data directly from the cPanel user backup files.
This tool will convert cPanel backups created by both:
- the /scripts/pkgacct script
- cPanel's 'Full Backup' GUI tool
Converted Items
- basic account allocations
- sub-domains
- FTP accounts
- POP3 and IMAP accounts
- All mail data (Maildir and/or mbox format**)
- Squirrelmail settings
- addon domains
- user home files
- mysql databases
- domain pointers
- crontab entries
- transfers resellers and their packages
- transfers subdomain/domain data from custom folders
- E-mail forwarders get transferred
- MX records in DNS zones get transferred
- RoundCube data
DirectAdmin supports a different feature set than cPanel. For example, DirectAdmin supports nginx/openlitespeed, MySQL8, rspamd etc., but it has no support for PostgreSQL or Ruby. So, if you have any sites using them - they'd need to be transferred manually.
cPanel server
- Create backups of all cPanel accounts on your cPanel server and place them in
/home/all_backups
mkdir -p /home/all_backups for user in `ls /var/cpanel/users/`; do { /scripts/pkgacct ${user} /home/all_backups; }; done
- Transfer your backups from your cPanel server to your DirectAdmin server:
rsync -avt --delete /home/all_backups/ root@your_directadmin_server.com:/home/admin/all_backups/
We're done with the cPanel server now. Let's connect to DirectAdmin server.
DirectAdmin server
- Make sure that:
a) your DirectAdmin version is at least 1.57.4
b) backup files in/home/admin/all_backups
are owned byadmin
c) you have the latest version of the conversion script (enter the command below to update):
cd /usr/local/directadmin/custombuild ./build update ./build cpanel_to_da chown -R admin. /home/admin/all_backups
- After transferring the accounts from the cPanel server, the converted cPanel accounts are now available in
/home/admin/all_backups
.
You can simply login to DirectAdmin and head to theAdmin Backup/Transfer
section. You should set the correct restoration directory for the backup files to appear and you should doublecheck theBackup/Restore Settings
(defaults should be fine).
You are now ready to restore your backups from the /home/admin/all_backups
directory.
Considerations and Known issues
- cPanel mdbox is supported in ver. 0.0.7, but hasn't been tested very throughly
- Mailman mailing lists do not get converted to majordomo mailing lists
- DirectAdmin format for mysql usernames/databases is always username_database and username_user. cPanel has the same format, but due to max username/database length it sometime shortens the username. cPanel allows myusername_ to have a DB username with myuserna_. DA DB names/usernames always start with myusername_, changing this would create a mess, for example, you could have myuserna user owning myuserna_db1 and myusername user owning myserna_db2. The script converts username to be username in such cases, so, for some accounts you might need to change database username/name in
wp-config.php
or other files CMS uses. - Max username length is 16 characters for MySQL users by default, and 10 for system user. Max username length can be increased in /usr/local/directadmin/conf/directadmin.conf
/usr/local/directadmin/directadmin set max_username_length 16 restart
- JetBackup format doesn't include cpmove-user directory inside, so, for now these need to be converted manually, like (would store converted backup in /home/admin/converted_user_backup):
jetbackup=yes /usr/local/directadmin/scripts/cpanel_to_da/cpanel_to_da.sh /home/admin/user_backups/cpmove-USERNAME.tar.gz /home/admin/converted_user_backup chown -R admin. /home/admin/converted_user_backup
Free Site Transfers
If you have backups in cPanel format that you wish to have converted to DirectAdmin please contact our sales team. We are more than happy to arrange the conversion for you.