A Let’s Encrypt certificate fails to be installed on a subdomain after migration:
PLESK_ERROR: Install certificate failure: Unable to set certificate name :
Subdomain was migrated from another server, where Let’s Encrypt certificate was already installed.
The Let’s Encrypt sub.example.com certificate cannot be found in the Domains > sub.example.com > SSL/TLS certificates
In the Plesk database, the subdomain’s Let’s Encrypt certificate exists, but it is assigned to the main domain:
MYSQL_LIN: mysql> SELECT c.id, c.name, r.rep_id, d.name FROM certificates c LEFT JOIN Repository r ON (c.id = r.component_id) LEFT JOIN domains d ON (r.rep_id = d.cert_rep_id) WHERE r.rep_id NOT IN (SELECT val FROM misc WHERE param = ‘cert_rep_id’) OR r.rep_id IS NULL;
| 1 | Lets Encrypt example.com | 1 | example.com |
| 2 | Lets Encrypt sub.example.com | 1 | example.com |
This is a Plesk Migrator bug with ID #PMT-3546, which will be fixed in future product updates.
As a workaround:
Connect to the server via SSH
Use the provided script (in the attachment) to identify and remove from the database the certificates wrongly assigned to the domains. Follow the instructions provided by it.
# wget https://plesk.zendesk.com/hc/article_attachments/360031352553/PMT-3546_Advisor.sh
# chmod a+x PMT-3546_Advisor.sh