SOLVED Remote User Account Transfer fails

GoWilkes

Well-Known Member
Sep 26, 2006
557
21
168
cPanel Access Level
Root Administrator
I'm transferring from my old VPS to new one. The old VPS is running CentOS 6.10 xen hvm and WHM v86.0.32, the new one is CentOS 7.9 virtuozzo and WHM v92.0.3.

I'm trying to transfer one account at a time, because some need a little TLC when they get to the new server.

I first tried using "Transfer Tool", but it gave errors regarding SSH; I didn't save the error message, but since I do not have SSH enabled on accounts on the old server I'm sure that's the problem.

So then I went to "Transfer or Restore a cPanel Account". I entered the old VPS's IP, the username for the account I'm transferring, and the password. On the next page, the "Transfer" result is 100% with no errors, but the "Restore" result has an error.

The log says (changing the account name to "example", and the IP to 123.45.67.89):

Code:
Starting “RESTORE” for “Account” “example”.
Restore File: /home/cpmove-example-1606885569.tar.gz
Restore Reseller Privs: no
Restricted mode: yes
Live transfer: no
Target “/home” on host “my.server.net” has 182.53 GB free and requires at least 18.63 MB free, which includes space for temporary files.
debug: Established cpanel session
Server Error from 123.45.67.89: 301 Moved
Removing copied archive “/home/cpmove-example-1606885569.tar.gz” from the local server …
Failed: Remote UAPI request error: Server Error from 123.45.67.89: 301 Moved at /usr/local/cpanel/Cpanel/RemoteAPI/Backend/cPanel.pm line 73.
The old server does create the .tar.gz file, so it's not an issue of reaching the old server. I've also disabled CSF on both servers, and that had no impact. The account is 17M and has a 50M quota, so there's not an issue of running out of space, either.

I've googled the error message and can't find anything; in fact, there's no results at all for "Remote UAPI request error". So I'm kind of at a loss.

Any suggestions on how to make it transfer properly? This was the smallest account to transfer that was supposed to be a quick test run! LOL
 

keat63

Well-Known Member
Nov 20, 2014
1,899
253
113
cPanel Access Level
Root Administrator
I'm pretty sure that both servers require SSH access, and to be able to talk to each other through the firewalls etc.
When I did mine, I ensured that both IP's where whitelisted in CSF, CPHULK and Host Acess Control
 

GoWilkes

Well-Known Member
Sep 26, 2006
557
21
168
cPanel Access Level
Root Administrator
Update: I added "Shell Access" to the account and tried to use "Transfer Tool", but it didn't work, either. The error message is very long, but it starts with:

Code:
The remote basic credential check failed due to an error (The system failed to escalate privileges to root on “123.45.67.89” with “sudo” or “su” because of an error: Failed to escalate to root) and response: Connecting to 123.45.67.89:1234 as example...using method password...Connection Success

Waiting for login prompt ....Done waiting for login prompt.
Normalizing user level shell...
Done normalizing shell.
Attempting to obtain root using method "sudo w/wheel pass"
Sending password for sudo w/wheel pass...
sudo w/wheel pass already failed, sending empty strings until it dies....
Failed because the user was not in the sudoers file
Resetting Terminal....Done.
Attempting to obtain root using method "su w/wheel pass"
Failed because the user did not have permission to run the command.
Resetting Terminal....Done.
Failed to obtain root.
warning ssh transport failed (The remote basic credential check failed due to an error (The system failed to escalate privileges to root on “123.45.67.89” with “sudo” or “su” because of an error: Failed to escalate to root) and response: Connecting to 123.45.67.89:1234 as example...using method password...Connection Success

Waiting for login prompt ....Done waiting for login prompt.
Normalizing user level shell...
Done normalizing shell.
Attempting to obtain root using method "sudo w/wheel pass"
Sending password for sudo w/wheel pass...
sudo w/wheel pass already failed, sending empty strings until it dies....
Failed because the user was not in the sudoers file
Resetting Terminal....Done.
Attempting to obtain root using method "su w/wheel pass"
Failed because the user did not have permission to run the command.
Resetting Terminal....Done.
Failed to obtain root.); trying whostmgr …
warning whostmgr transport failed (Net::WebSocket::X::BadHTTPStatus: Received invalid HTTP status: 401 (Access Denied) - must be 101
(followed by dozens of lines of modules that failed; I can paste the entire list if it's necessary)

I double checked that I can SSH to the account using the username and password, so that's not the problem here, either.

I also wanted to mention that, on the new VPS, I do not have a directory created for /home/example. So the script obviously never made it that far.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
3,186
398
243
cPanel Access Level
Root Administrator
In the most recent error output, it's wanting to use the root user to perform the transfer. If you're using Transfer Tool in WHM, that is a root-level migration tool, so you'd need root access to the Source machine to perform that work.

If you don't have root access to the Source, it would be better to use the "Transfer or Restore a cPanel Account" function in WHM on the Destination as the cPanel user.
 

GoWilkes

Well-Known Member
Sep 26, 2006
557
21
168
cPanel Access Level
Root Administrator
I have root access to both VPSs, and I turned off the firewall on both servers. I don't have Host Access Control set up on either machine. I didn't think to disable cPHulk, though, so I'll try that tonight.


The settings I used under "Transfer or Restore a cPanel Account" were:

Enable Restricted Restore: off
Transfer from Remote cPanel Account: on
Remote Server: 123.45.67.89 (just the IP, no protocol)
Remote username: example (the actual username for the account on the old server)
Remote password: [password for example]
Dedicated IP Address: off

This is the method that worked to compress the account on the old VPS, so connecting wasn't an issue. It just wouldn't copy the .tar.gz file to the new VPS. This makes me think that the issue isn't with cPHulk, but it has to be a setting... somewhere.


The settings I used in "Transfer Tool" (which is supposedly the "best" option, although I don't know why) were:

Remote Server Address: 123.45.67.89 (just the IP, no protocol)
Remote SSH Port: 1234 (not the real port, of course, but I entered the right one)
Login: User
Username: example (the actual username for the account on the old server)
Authentication Method: Password
Password: [password for example]
Root Escalation Method: su
Root Password: [password for "root"]
Restricted Restore: off

Advanced
Remote Server Type: cPanel & WHM

Everything else was left to the default. I also tried using sudo instead of su, but that didn't change anything. This method didn't seem to do anything, it failed while trying to connect to the old VPS.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
3,186
398
243
cPanel Access Level
Root Administrator
It's interesting to me that Transfer Tool fails to connect at all, as that would indicate an SSH issue, most likely. It might be best to have us look at the systems through a ticket if you'd like to submit one. If you do, please include the ticket number here so I can update the community with our findings.
 

GoWilkes

Well-Known Member
Sep 26, 2006
557
21
168
cPanel Access Level
Root Administrator
It's resolved now, and it appears to have been an ID-ten-T error on my end :-O

There wasn't a resolution to the "Transfer or Restore a cPanel Account" error, but the tech figured out my problem with "Transfer Tool". I was applying the User on the first screen, under Authentication > Login. But per John:

Code:
When selecting "User" instead of "root" the interface will ask for the "Root Escalation Method" which requires the selection of "su" or "sudo". The
su and sudo commands are used to escalate from a user to the root user. In order to use su or sudo, the provided user must be added to the "wheel" group
on the source server. "User" is typically used instead of "root" in Trasfer Tool when the remote/source server does not allow direct root SSH logins.
The appropriate method would have been to select "Root (default)", then the next page let's me select the account that I want to transfer.

I didn't know that... it appeared that selecting Root here would have transferred the entire server.

Regardless, selecting Root and then selecting the account to be transferred on the second page worked without any errors :)