WHM (cPanel): How to Kill a Stuck Transfer

Had to move accounts between servers today. Naturally used the WHM Transfer tool. One of the batches got stuck mid-process. Unfortunately the developers didn’t add a terminate button.

So what do you do in this case? In the active transfer window there’s this entry:

You may close this window and view the transfer on the command line: **/usr/local/cpanel/bin/view_  
srccopya201410081920225pq211Nuc1jZ6z**

If you run it from the command line - you’ll get something like this:

Transfer running with pid: 795  
[795][MASTER]: Start Session  
[795][MASTER]: Version: 1.9  
[795][MASTER]: Queue “TRANSFER” items: 1

With the pid you can kill the process using kill -9

I was less lucky and there was no pid in the output. I found this bad process using ps:

ps aux |grep transfer

As a result we get:

root 13296 0.0 1.2 163572 51608 ? Ss 19:20 0:00 transfer_session - srccopya201410081920225pq211Nuc1jZ6z - MASTER  
root 13298 0.0 1.4 171224 59592 ? S 19:20 0:00 transfer_session - srccopya201410081920225pq211Nuc1jZ6z - RESTORE:1

Again you can kill these processes using kill -9

All that’s left is to tell WHM that the transfer is finished, otherwise it’ll hang around in the history as incomplete.

To do this, open the mysql console and run the following commands:

select * from whmxfer.sessions where sessionid='srccopya201410081920225pq211Nuc1jZ6z';

Double check that the completion percentage (state) isn’t a hundred and the transfer end time record (endtime) is absent (NULL)

So let’s tell it this task is done:

update whmxfer.sessions set state='100′, endtime='now()' where sessionid='srccopya201410081920225pq211Nuc1jZ6z';