How to Transfer a Single Account from cPanel to DirectAdmin


Moving a single account from cPanel to DirectAdmin can be completed with just a few steps. This guide will walk you through the process, ensuring a smooth and successful migration.


Step 1: Create a Backup on the cPanel Server

To transfer a single account, start by creating a backup using the pkgacct script. Follow these steps:

Backup the account
Replace username with the actual cPanel username you want to transfer:

/scripts/pkgacct username /home/user_backups;

This command creates a backup of the account and stores it in the /home/user_backups directory.

Transfer the backup to the DirectAdmin server
Use rsync to securely copy the backup file to the DirectAdmin server. Replace your_directadmin_server.com with your DirectAdmin server’s hostname or IP:

rsync -avt /home/user_backups/ root@your_directadmin_server.com:/home/admin/converted_user_backup/

Once the transfer is complete, proceed to the DirectAdmin server.


Step 2: Prepare and Restore the Backup on DirectAdmin

Ensure correct ownership of the backup
Log in to your DirectAdmin server and set the ownership of the backup to the admin user:

chown -R admin. /home/admin/converted_user_backup

Restore the backup via DirectAdmin interface

  • Log in to DirectAdmin as the admin user.
  • Navigate to the Admin Backup/Transfer section under Admin Level.
  • Set the path to the backup directory as /home/admin/converted_user_backup.
  • Select the backup file and restore it.
Ensure that the backup filename follows the correct naming format (e.g., cpmove-username.tar.gz) to be recognized by DirectAdmin.

Important Notes

  1. Correct backup naming
    The pkgacct command creates backups in the format cpmove-username.tar.gz. If your file is named differently (e.g., user.tar.gz or backup-...._user.tar.gz), DirectAdmin will not recognize it. To fix this, you can rename the files:
    • Rename files like user.tar.gz to cpmove-user.tar.gz: for i in `ls *.tar.gz | grep '^[A-Za-z0-9]*.tar.gz'`; do { mv -vf ${i} cpmove-${i}; }; done
    • Rename files like backup-...._user.tar.gz to cpmove-username.tar.gz: for i in `ls backup-[0-9]*.*.tar.gz`; do { USERNAME=`echo $i | cut -d_ -f3 | cut -d'.' -f1`; mv -v $i cpmove-${USERNAME}.tar.gz; }; done
  2. Backup file format
    Ensure the file retains the cpmove-username.tar.gz format after renaming. This format is mandatory for DirectAdmin to recognize and process the backup.

Conclusion

By following these steps, you can seamlessly migrate a single cPanel account to DirectAdmin. This method ensures data integrity and minimizes downtime during the transfer process.

If you encounter issues or have specific questions, feel free to comment below. Happy hosting! 😊