Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
Plesk-to-Plesk migration was finished and all migrated subscriptions were reassigned to Plesk Administrator.
How to change the subscription owners as on the source server if it's not possible to remove these subscriptions and re-migrate them?
Answer
-
Get a list of customers and their subscriptions (without resellers):
Linux:# plesk db -Ne "SELECT d.name,c.login FROM domains d JOIN clients c ON d.cl_id=c.id WHERE d.cl_id <> 1 and webspace_id=0" > result.txt
example.com johndoe1
example.org johndoe2Windows:
C:\> plesk db -Ne "SELECT d.name,c.login FROM domains d JOIN clients c ON d.cl_id=c.id WHERE d.cl_id <> 1 and webspace_id=0" > result.txt
example.com johndoe1
example.org johndoe2 -
Transfer the created file to the target server and connect to it via SSH or RDP.
-
Create customers using the
result.txtfile:
Linux:# while read subs customer ; do plesk bin customer --create $customer -name $customer -passwd sample_passsword ; done < result.txt
Windows:
C:\> for /F "usebackq tokens=1-2" %a in (`type result.txt`) do plesk bin customer --create %b
-
Assign the subscriptions from
result.txt(they should already be migrated on the target server) to the newly created customers: Linux:# while read subs customer; do plesk bin subscription --change-owner $subs -owner $customer;done < result.txt
Windows:
C:\> for /F "usebackq tokens=1-2" %a in (`type result.txt`) do plesk bin subscription --change-owner %a -owner %b
Comments
Please sign in to leave a comment.