change reseller ownership

How to change the reseller ownership from one reseller user to another reseller user by using SSH

Ans:
If you want to change the reseller ownership means the old reseller is “test” and you have created new account with the user name “indian” and you want to move all the domains which is under the reseller “test” to “indian” then you need to change the ownership of all the accounts manually by using reseller center but you can easily change the reseller ownership by using following script.
Suppose :
Old Reseller Username = test
New Reseller Username = indian
1) First you need to find out the user name which is under the old reseller ( test) account by using following command
cd /var/cpanel/users
grep "OWNER=test" * -R | awk -F: '{print $1}' > user_name
cat /var/cpanel/users/user_name

It shows all the user name which is under the old reseller account.
2) Then create script file
vi /var/cpanel/users/test.sh
Then enter the follwoing code
#!/bin/sh
for user in `cat user_name`
do
/usr/bin/replace 'OWNER=test' 'OWNER=indian' -- /var/cpanel/users/$user
done
/scripts/updateuserdomains

Save the file
chmod 755 /var/cpanel/users/test.sh
sh /var/cpanel/users/test.sh
Done
Now login to your new reseller account and check all the accounts.
Note : Please replace the “test”= Old reseller name and “indian”= New reseller username

Related posts

2 Thoughts to “change reseller ownership”

  1. Nyoman [D]

    Thanks…
    I got quick way to change owner/reseller, based on your how to
    cd /var/cpanel/users
    perl -pi -e ‘s/OWNER=test/OWNER=indian/g’ *
    Now all account on test will change under indian reseller

Leave a Comment