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.
cpmove-username.tar.gz
) to be recognized by DirectAdmin.
Important Notes
- Correct backup naming
Thepkgacct
command creates backups in the formatcpmove-username.tar.gz
. If your file is named differently (e.g.,user.tar.gz
orbackup-...._user.tar.gz
), DirectAdmin will not recognize it. To fix this, you can rename the files:- Rename files like
user.tar.gz
tocpmove-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
tocpmove-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
- Rename files like
- Backup file format
Ensure the file retains thecpmove-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! 😊