• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Migrating only customers (but not subscriptions)

Server operating system version
CentOS Linux 7.9.2009 (Core) -> AlmaLinux 8.8 (Sapphire Caracal)
Plesk version and microupdate number
Plesk Obsidian Web Pro Edition Version 18.0.61 Update #4
According to this knowledgebase article:
https://support.plesk.com/hc/en-us/...ubscriptions-are-owned-by-Plesk-Administrator
If customers were not migrated, the only way to correct the issue is to delete all the subscriptions on the target server and rerun the migration.

This is not an option for me, as I'd already switched the destination server live when I discovered that the customers had not been migrated.

I don't have a problem manually reassigning subscriptions to their correct customers, but manually re-entering all the customer details is going to be time consuming.

I'm sure other people may have the scenario of wanting to sync customers between different servers without necessarily wanting to migrate subscriptions.

Is there any way to migrate or export/import just customers without making any changes to subscriptions on the destination server?
 
You could use the Plesk REST API to fetch your existing customers from your 'old' server and create them on you 'new' server. That would save you the time to manually add every customer on your new server. There is a caveat, mainly that customers passwords aren't export by the REST API.

You can then manually reassign the subscriptions to each customer.

I've created this Bash script as an example that you can adapt for your own use. You can use run it on the target server. Note that all customer accounts are created with the same password in this script as the existing passwords cannot be exported via the REST API. Use at your own risk.

Code:
#!/bin/bash

# Connect to source server
# Replace the basic authorization roken (YWRtaW46YWRtaW4=) with a base64 token of the
# admin user name and password (admin:mypassword) of the source server

JSON=$(curl -X 'GET' \
  'https://old.yourserver.com:8443/api/v2/clients' \
  -H 'accept: application/json' \
  -H 'authorization: Basic YWRtaW46YWRtaW4=')

# Create customers on the target server
# Replace the basic authorization roken (YWRtaW46YWRtaW4=) with a base64 token of the
# admin user name and password (admin:mypassword) of the target server

readarray -t clients < <(echo $JSON | jq -c '.[]')
for i in "${clients[@]}"; do
  curl -X 'POST' \
  'https://newserver:8443/api/v2/clients' \
  -H 'accept: application/json' \
  -H 'authorization: Basic YWRtaW46YWRtaW4=' \
  -H 'Content-Type: application/json' \
  -d "{

  \"name\": \"$(jq --raw-output '.name' <<< "$i")\",
  \"company\": \"$(jq --raw-output '.company' <<< "$i")\",
  \"login\": \"$(jq --raw-output '.login' <<< "$i")\",
  \"email\": \"$(jq --raw-output '.email' <<< "$i")\",
  \"locale\": \"$(jq --raw-output '.locale' <<< "$i")\",
  \"description\": \"$(jq --raw-output '.description' <<< "$i")\",
  \"password\": \"Cha22fngeme1Q**\",
  \"type\": \"customer\"
}"

done
 
Thanks. That worked. I modified it to work with a secret key as I don't have the root password on the new server, but was able to use the Plesk CLI to generate a secret key and used that instead.
 
Back
Top