Migrate cPanel to DirectAdmin

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.

On the cPanel server

1. 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

2. 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 the DirectAdmin server!

On the 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 by admin
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 the "Admin Backup/Transfer" section. You should set the correct restoration directory for the backup files to appear.

Done!

 

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

- 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
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.

Articles in this section

See more