DirectAdmin vs cPanel + a Lazy SysAdmin's Migration Automation Bash Script


Verified User
Jul 10, 2019
HI Y'ALL! ;)

For those considering migrating from cPanel to DirectAdmin and worried because you don't know what to expect, here is the most thorough comparison of the two panels I've found:

And don't worry! DirectAdmin is great!

Also, if you are lazy like me and would like to perform a migration with as little effort as possible, I reckon I could share the following that I wrote a month ago or so. Use like so:

1) log into your DA server as root
2) wget
3) run it like so:
./cpmigration -i [cPanel IP] -o [ssh port] -u [cPanel username to be migrated]
4) Enter the cPanel root password when prompted (not safe to pass on the CLI)

That's it! It will do the following:

1) Prevent unintentional SSH lockouts due to DA's restore tool adding "AllowUsers $user" to the sshd_config by first adding "AllowUsers root, admin" to the sshd_config if not present
2) increase the max username length in DA if necessary
3) warn about potential MySQL DB length compatibility issues
4) use expect to log into the cPanel server and create the backup
5) rsync the backup
6) download updated DA conversion scripts
7) convert the backup
8) restore the backup

And it logs everything to migration.log in the pwd !

Currently, this only supports singe accounts and I hope to add support for a list of accounts, or all accounts in the future when I find time. The expect portion of the script doesn't support custom prompts (but this is still useful for large providers whose customer base rarely changes the prompt).

I hope this helps someone!


Verified User
Sep 21, 2019
Looks useful, I will have to look deeper into your tutorial and script here later