Migrating Direct Admin accounts to cPanel server
In this tutorial, We are going to see how to migrate accounts from a Direct Admin server to a cPanel server.
Migrating accounts manually is surprisingly a simple task. The things we need to done.
- Populate /etc/trueuserdomains on the source server
- Package an account into a single file
- Copy the packaged account to the cPanel server
- Restore the account on the cPanel server
On the source server (Direct Admin) download the following scripts which builds the list of accounts
Now download the script, that packages the accounts
Make the both scripts executable
chmod +x updateuserdomains-universal chmod +x pkgacct-*
This will create a plan text at /etc/trueuserdomains with list of domain name and it user that can be packaged.
To package an account, select a user from /etc/trueuserdomains and run the pkgacct script file as below.
This will package the entire account to a single file and stores in /home/username.tar.gz
To move the backups to specific folder use the below command
./pkgacct-da username /backup/cpbackup
The drawback is you have to run this command for each accounts in /etc/trueuserdomains file.
Once the conversion completed, use rsync commad to move the backup files to new cPanel server.
Note : If you are getting the following error
Can't locate Digest/MD5.pm in @INC (@INC contains: /tmp/JSXFWg6ryr/lib /tmp/JSXFWg6ryr/lib /usr /local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /tmp/JSXFWg6ryr/lib/Cpanel/Pkgacct/Archive/Writer.pm line 12. BEGIN failed--compilation aborted at /tmp/JSXFWg6ryr/lib/Cpanel/Pkgacct/Archive/Writer.pm line 12. Compilation failed in require at /tmp/JSXFWg6ryr/lib/Cpanel/Pkgacct/Archive.pm line 37. BEGIN failed--compilation aborted at /tmp/JSXFWg6ryr/lib/Cpanel/Pkgacct/Archive.pm line 37. Compilation failed in require at /tmp/JSXFWg6ryr/scripts/main.pl line 28. BEGIN failed--compilation aborted at /tmp/JSXFWg6ryr/scripts/main.pl line 28.
You need to install Digest-MD5 in direct admin server by using the below command
yum install perl-Digest-MD5 -y
Once you installed, try ./pkgacct-da username to proceed with backup
Hope this helps your need, Please share your comments to improve us.