Articles in this section

How to assign subscriptions to the same customers on the target server as on the source server when Plesk migration was finished?

Plesk for Windows kb: how-to Plesk for Linux Migration

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

  1. Connect to the source server via SSH or RDP.

  2. 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   johndoe2  

    Windows:

    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  

  3. Transfer the created file to the target server and connect to it via SSH or RDP.

  4. Create customers using the result.txt file:
    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

  5. 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

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.