How to migrate cPanel accounts to DirectAdmin
Move cPanel accounts into DirectAdmin with the built-in migration tool, then verify MySQL databases, mailboxes and file ownership on your Linux VPS.
- Advanced
- Linux VPS
- 4 min read
To migrate cPanel accounts to DirectAdmin you move website files, MySQL databases, mailboxes and DNS records onto the new server, then fix ownership and paths so DirectAdmin's services can read them. DirectAdmin includes a migration tool that reads a cPanel backup or pulls straight from the old server over SSH. This guide covers preparing both servers, running the import, and checking that mail and databases arrived intact.
Before you start
You need:
- DirectAdmin installed and licensed on the destination VPS. Panel licences come from the DirectAdmin vendor, not from RunRacks — check the vendor's site for current plans and activation. If DirectAdmin isn't installed yet, follow install DirectAdmin on AlmaLinux.
- Root SSH access on both machines. See connect to your Linux VPS with SSH if you're setting that up.
- A full backup of the cPanel server, plus a list of the domains, databases, mail accounts and cron jobs in scope.
- Roughly double the account's disk usage free on the destination.
Check free space before you start:
df -h /homeDo not move live DNS to the new server until the import and checks are finished. Migrate while the old server still answers for the domain, then switch DNS once files, databases and mail are confirmed.
Create a matching hosting package
The migration tool assigns each imported user to a hosting package. Build one first with the same quota, bandwidth, email and database limits as the cPanel account so nothing is cut short.
In DirectAdmin, go to Admin Level, open Packages, and create the package. Note its exact name — you'll select it during the import. The manual route is described in DirectAdmin: create a user and a hosting package.
Make a cPanel account backup
On the cPanel server, run pkgacct as root to produce a single migration file:
/usr/local/cpanel/scripts/pkgacct deploy /home/backupYou should end up with /home/backup/cpmove-deploy.tar.gz. Confirm it:
ls -lh /home/backupCopy it to the DirectAdmin server:
rsync -avz -e ssh /home/backup/cpmove-deploy.tar.gz [email protected]:/home/admin/migrations/Mail archives are usually the slowest part of a migration. Transfer them during a quiet period and keep the old server online until the DNS switch.
Run the cPanel to DirectAdmin migration
DirectAdmin's migration tool lives in the admin area. Newer builds list it as Site Migration; older ones expose it as a cPanel migration plugin. Menu labels change between versions, so confirm the current name in DirectAdmin's documentation for the version you run.
There are two ways to feed it data:
- From the backup file — point the tool at
/home/admin/migrations/cpmove-deploy.tar.gz, or upload the file through the interface. Choose the destination package and start the import. - From the live cPanel server over SSH — supply the old server's IP, root password and the account name. The tool pulls files, databases and mail in one pass.
The import can take minutes or hours depending on mailbox size. Don't close the browser tab while it runs: an interrupted session can leave a half-created user, which you then delete and redo.
Verify databases
Migrated databases normally keep their names, but DirectAdmin's MySQL administrator is not the same account as cPanel's. Its credentials sit in a config file:
cat /usr/local/directadmin/conf/mysql.conf
mysql -uda_admin -p -e "SHOW DATABASES;"Check tables and approximate row counts for an account database:
mysql -uda_admin -p -e "SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema='deploy_wp';"If a database is missing, move it by hand. Dump it on the old server:
mysqldump --single-transaction --routines --triggers deploy_wp > /home/deploy/deploy_wp.sqlThen load it on the new one:
mysql deploy_wp < /home/deploy/deploy_wp.sqlFinally make sure the application config (for example wp-config.php) uses the database user DirectAdmin created, and recreate that user in the DirectAdmin user panel if it wasn't mapped.
Verify mail
cPanel stores mailboxes under /home/user/mail/. Current DirectAdmin builds use /home/user/imap/domain/user/Maildir/, while older ones use mail/. Check which layout applies:
ls /home/deployIf messages are missing, sync the Maildir contents across:
rsync -avz -e ssh /home/deploy/mail/example.com/deploy/ \
[email protected]:/home/deploy/imap/example.com/deploy/Maildir/Stop Dovecot on the destination before the mail sync so messages delivered mid-c
Was this guide helpful?
Still stuck?
Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.
Related guides
Control panels
How to install Plesk on a Linux VPS (AlmaLinux and Ubuntu)
Install Plesk on a fresh Linux VPS with the official one-click installer, apply your licence key and log in to the panel for the first time on port 8443.
- Beginner
- Linux VPS
- 8 min read
Control panels
CyberPanel: back up and restore a website
Create on-demand and scheduled website backups in CyberPanel, download the archives off the server, and restore a site from a backup when something breaks.
- Intermediate
- Linux VPS
- 6 min read
Control panels
Plesk Backup Manager: schedule backups and restore a site
Set up scheduled backups in Plesk Backup Manager, keep a copy off the server, and restore a single domain or subscription when something goes wrong.
- Intermediate
- Linux VPS
- 7 min read