Transfer Tool unable to overwrite duplicate username

katmai

Well-Known Member
Mar 13, 2006
564
4
168
Brno, Czech Republic
i am experiencing the same issue @cPanelMichael

i have 2 whm servers. i cloned 3 accounts from server 1 to server 2
i made some updates on server 1 to these accounts, so i used whm to terminate them from server 2
then i used transfer tool to try to copy them to server2 again and i am getting:
------------------------------------------------
Error: You have selected 2 accounts that cannot transfer properly because their usernames conflict with usernames on the local server.

  • The remote account “account1” cannot transfer because an account with the same username exists on the local server.
  • The remote account “account2” cannot transfer because an account with the same username exists on the local server.

Overwrite conflicted accounts

Deselect conflicted accounts
------------------------------------------------
Selecting overwrite gives me this:

RESTORE: Account “account1”: Account Restore Failed: “Homedir failure: Security violation: The home directory was not provided.”
The “Homedir” restore module failed because of an error: Security violation: The home directory was not provided.
RESTORE: Account “account2”: Account Restore Failed: “Homedir failure: Security violation: The home directory was not provided.”
The “Homedir” restore module failed because of an error: Security violation: The home directory was not provided.

this is happening with both servers being
  • v78.0.18
 
Last edited by a moderator:

katmai

Well-Known Member
Mar 13, 2006
564
4
168
Brno, Czech Republic
@cPanelMichael - Just a small update on this matter: i was able to do manual pkgacct snapshots and transfer them over and restore them with the "restore a full backup/cpmove file" but i have about 500 accounts to transfer - i'd love it if the transfer tool would work so i don't have to do this manually.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Hi @katmai

Since you got the problematic accounts moved, is this occurring with accounts that you've not attempted to transfer before? It sounds like there may have been a conflict due to the accounts having cruft or leftover data on the destination server.
 

katmai

Well-Known Member
Mar 13, 2006
564
4
168
Brno, Czech Republic
it hasn't happened with accounts that were never moved before. only with accounts that i transferred, tested if things work properly, then deleted them and retried the transfer 2-3 days later.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Hi @katmai

So two ways to go about this here

1. And this is my suggested method: I'd like to see if you can open a ticket so that we can find out why when you're removing the accounts they aren't being fully removed. If you choose to do this you can do so using the link in my signature. Please post the ticket ID here as well so that we can update this thread with the outcome.

2. You could do some testing on your own with a tool we use internally:

a. Step one transfer an account
b. remove the account
c. Attempt to transfer again
d. If the transfer fails - run the following to see what cruft is being left over:

Code:
           /usr/local/cpanel/3rdparty/bin/perl <(curl -s https://raw.githubusercontent.com/cPanelInc/tech-acctinfo/master/acctinfo)
As well as check cPanel error logs for errors when the account has been removed.


Thanks!
 

katmai

Well-Known Member
Mar 13, 2006
564
4
168
Brno, Czech Republic
perfect, thanks, i will do this the next time it happens.
 

AngryDragon

Registered
Apr 5, 2019
4
0
1
Gouda
cPanel Access Level
Root Administrator
Excuse me for interfering in your thread.

I have exactly the same issue: migrating from one server to another, using test accounts.
deleting that account on the new server, and trying to redo the transfer.
getting "username conflicts with a username on the local server" and continuing with 'overwrite' resulting in "Account Restore Failed: Homedir failure: Security violation: The home directory was not provided.”
(v78.0.20 btw)

cPanelLauren's suggestion (acctinfo) with parameters --cruft <user>, found leftovers in "/var/cpanel/users" where a file exists with the accountname which should have been gone.

manually removed that file.
still the same warnings / errors.
acctinfo cruft finds nothing anymore.

any suggestions?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
@AngryDragon and @Peoplespaces what versions of cPanel are you using?

If accntinfo finds nothing and you run the following:

Code:
/scripts/updateuserdomains
/scripts/updateuserdatacache
mv /etc/apache2/conf/httpd.conf{,.bk}
/scripts/restartsrv_httpd
/scripts/rebuilddnsconfig
Do you get the same error?

Thanks!
 

AngryDragon

Registered
Apr 5, 2019
4
0
1
Gouda
cPanel Access Level
Root Administrator
Started over with a new / fresh VPS with v78.0.20:

1 Used the transfer tool for 1 account from source to the new / fresh target
2 checked / tested account on new fresh target: all data moved - working as expected
3 deleted account on new fresh target (using account panel / terminate): sucessful deleted in logfiles.
4 restarted transfer tool for same account

well, all as noted above in my messages and in PeopleShares messages.
even after the scripts and the cruft check same errormessages come up and transfer failes to restore.

seems to me that either one of the following is occuring:
- delete / terminate account is not deleting completely although log sais it did.
- transfer tool is checking for available user where it shouldnt.
- transfer tool is checking for available user where 'cruft' check doesnt look.
- transfer tool: homedirectory is not taken in account when transferring for an existing account.

not much more i can do for now :(
 

akamaras

Member
Dec 16, 2009
23
1
53
I had the same issue
Issue solved with the following
  • I deleted the file under /var/cpanel/users/
  • I executed /usr/local/cpanel/scripts/updateuserdomains
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Just deleting the one file wouldn't resolve the issue. When an account is created (or partially created) there are a series of files that are created along with it. If you're unable to identify the files I'd suggest opening a ticket.
 

stwno

Registered
Jan 28, 2021
1
1
3
Oslo
cPanel Access Level
Root Administrator
Had the same issue on 86.0.36

Ran the cruft tool also, but it returned negative results on all checks.
/usr/local/cpanel/3rdparty/bin/perl <(curl -s https://raw.githubusercontent.com/cPanelInc/tech-acctinfo/master/acctinfo) --cruft <domain>

Finally grepped recursively an account name from /etc, and i found passwd.cache and renamed the file

# mv /etc/passwd.cache /etc/passwd.cache-old

I ran the transfer tool again, and finally the transfer was successful.
 
  • Like
Reactions: cPRex