How to Migrate Website from DirectAdmin to cPanel

Introduction

WHM’s transfer tool is a great way to migrate accounts from DirectAdmin to cPanel.

Often, when the website content is very large, migration with this transfer tool can fail. Here, one possible workaround is to migrate account manually.

Step 1 — Build Domain List

First and foremost, we build the list of domains on the DirectAdmin server that needs to be migrated.  To make this list, we use the script provided by cPanel which can be downloaded at

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

Then we download the actual script to package account using the command :

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

We give executable privileges for the scripts.

$ chmod +x updateuserdomains-universal
$ chmod +x pkgacct-da

Then we run the following command, we get a plain text file at /etc/trueuserdomains. This file contains a list of accounts that can be packaged.

$ ./updateuserdomains-universal
Step 2 — Package Account
Now, to package an account with username ‘sven’, use the command
$ ./pkgacct-da sven

This will package the entire account to a single file at /home/cpmove-sven.tar.gz

The time taken to package the account depends on the actual size of the website. So, our cPanel Specialists run this command in “screen” so that even when the server session disconnects, packaging continues.

Step 3 — Copy to New cPanel Server

The next step is to copy the account to the new cPanel server.

From the DirectAdmin server, execute :

$ scp /home/cpmove-sven.tar.gz [email protected]:/home

Here we need to substitute x.x.x.x with the IP address of new cPanel server. The backup file will be copied to the /home directory.

Step 4 — Restore Account

Once the file is in the new server, we can restore the account using the command:

$ cd /home
$ /scripts/restorepkg cpmove-sven.tar.gz

 

We run this command on “screen” to avoid any possible termination of account restore due to connection issues.

If there are multiple accounts for migration, we migrate the accounts in small batches.

After account restore, check and confirm the working of the website using “temporary url” which is based on the IP address of new server. This includes the checking of sub-links and functionalities of the website.

Once everything works as expected, we change the dns of the domain and delete the cpmove file from the server. That completes the entire process of migration.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?