How to Migrate a Single cPanel Account to DirectAdmin


How to Migrate a Single cPanel Account to DirectAdmin

Switching from cPanel to DirectAdmin is becoming more common due to rising cPanel licensing costs. DirectAdmin provides a lightweight, cost-effective alternative, but migrating accounts between the two control panels requires some manual work.

In this guide, we’ll cover how to migrate a single cPanel user account to DirectAdmin using the built-in migration tools.


Prerequisites

Before starting, ensure you have:

  • Root SSH access to both the cPanel server and the DirectAdmin server.
  • Enough disk space on both servers to create and transfer backups.
  • rsync or scp installed (usually preinstalled).

Step 1: Create a cPanel Backup

On the cPanel server, we need to generate a full account backup using cPanel’s pkgacct tool.

Run this command (replace USERNAME with the actual cPanel username):

/scripts/pkgacct USERNAME /home/user_backups

This will create a backup file in the /home/user_backups directory.
The backup file will look like:

/home/user_backups/cpmove-USERNAME.tar.gz

Step 2: Transfer the Backup to DirectAdmin Server

Once the backup is ready, copy it to your DirectAdmin server. You can use rsync or scp.

Example with rsync:

rsync -avt /home/user_backups/cpmove-USERNAME.tar.gz root@your_directadmin_server.com:/home/admin/

🔑 Make sure you replace your_directadmin_server.com with your server’s hostname or IP.

Now the cPanel backup is on the DirectAdmin server in /home/admin/.


Step 3: Convert the Backup for DirectAdmin

DirectAdmin cannot restore a raw cPanel backup directly. We need to convert it first using the built-in cpanel_to_da tool.

On the DirectAdmin server, run:

/usr/local/directadmin/shared/cpanel_to_da/cpanel_to_da.sh /home/admin/cpmove-USERNAME.tar.gz /home/admin/converted_user_backup/

This command will extract and convert the backup into a format that DirectAdmin can import.


Step 4: Fix Ownership of the Converted Backup

Ensure the converted files belong to the admin user, otherwise DirectAdmin won’t see them.

Run:

chown -R admin:admin /home/admin/converted_user_backup

Step 5: Restore the Account in DirectAdmin

Now we’re ready to restore the converted account from inside DirectAdmin.

  1. Log in to DirectAdmin as admin.
  2. Go to:
    Admin Level → Admin Backup/Transfer → Restore
  3. Set the backup path to: /home/admin/converted_user_backup
  4. Select the backup and click Restore.

DirectAdmin will now import the account, including:

  • Website files
  • Databases
  • Emails
  • DNS settings

Step 6: Verify the Migration

After restoration:

  • Log in as the migrated user to check the website files.
  • Verify MySQL databases are working correctly.
  • Test email accounts.
  • Confirm DNS and domains are properly configured.

Common Issues

  • Database errors: Sometimes MySQL versions differ between servers. Export and import databases manually if needed.
  • Email issues: Check email paths and adjust if the user had custom mail setups.
  • Disk space: Ensure your /home/admin/ directory has enough space before transferring large accounts.

Conclusion

Migrating a single cPanel account to DirectAdmin is straightforward with the pkgacct tool and DirectAdmin’s cpanel_to_da converter.

The process can be summarized as:

  1. Create a cPanel backup with pkgacct.
  2. Transfer the backup to DirectAdmin.
  3. Convert it with cpanel_to_da.sh.
  4. Restore it via the DirectAdmin admin panel.

This ensures websites, databases, and emails move smoothly during your cPanel to DirectAdmin migration.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *