Migrating Direct Admin accounts to cPanel server

Direct admin accounts to cpanel

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.

  1. Populate /etc/trueuserdomains on the source server
  2. Package an account into a single file
  3. Copy the packaged account to the cPanel server
  4. Restore the account on the cPanel server
Step 1

On the source server (Direct Admin) download the following scripts which builds the list of accounts

wget http://httpupdate.cpanel.net/cpanelsync/transfers_DEVEL/pkgacct/updateuserdomains-universal
Step 2

Now download the script, that packages the accounts

wget http://httpupdate.cpanel.net/cpanelsync/transfers_DEVEL/pkgacct/pkgacct-da
Step 3

Make the both scripts executable

chmod +x updateuserdomains-universal
chmod +x pkgacct-*
Step 4

Now execute

./updateuserdomains-universal

This will create a plan text at /etc/trueuserdomains with list of domain name and it user that can be packaged.

Step 5

To package an account, select a user from /etc/trueuserdomains and run the pkgacct script file as below.

./pkgacct-da username

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

Step 6

Use Restore a Full Backup/cpmove File or /scripts/restorepkg command to restore the backup in cPanel server.

Hope this helps your need, Please share your comments to improve us.

To know how to use external mail server in direct admin click here.