Applicable to:
- Plesk for Windows
- Plesk for Linux
Symptoms
- Migration Plesk to Plesk was performed.
- WHMCS is used on the server.
- The following error is shown when accessing user with login 'example' in Plesk via WHMCS:
PLESK_INFO: Error code: 1013. Error message: Customer with external id 'whmcs_plesk_XX' is not found in panel.
-
External_id
is missing for the user with login 'example':MYSQL_WIN: mysql> select external_id from clients where login='example';
Empty set (0.00 sec)
Cause
This is caused by the Plesk Migrator bug #PMT-3035 which been already fixed for all versions.
Resolution
The solution for the migration via UI is planned for the next Plesk Migrator release with no ETA in the scope of User Story PMT-4819.
Warning: Do not share the ID #PMT-4819 with the customers as it will not be mentioned in the changelog, however the changelog will have some mention of this fix when it comes.
As a solution, external_id
can be updated via command line now:
-
Connect to the target server via RDP;
-
Copy sample configuration file from the
%plesk_dir%\admin\plib\modules\panel-migrator\backend\conf\samples\plesk-windows.ini
file to the<PLESK_DATA_DIRECTORY>\var\modules\panel-migrator\conf\
directory. To find$PLESK_DATA_DIRECTORY
location on the server use the following command:C:\> reg query "HKLM\SOFTWARE\Plesk\PSA Config\Config" /v PRODUCT_DATA_D /reg:32
Note: If the folder
<PLESK_DATA_DIRECTORY>\var\modules\panel-migrator\conf\
does not exist, create it and place the file into it. -
Rename
plesk-windows.ini
toconfig.ini
-
Specify IP addresses of source and target server and their credentials in
config.ini
file, for example:CONFIG_TEXT: [plesk]
; An IPv4 address of the target Plesk server.
ip: 203.0.113.200
; Panel administrator's login. If not specified, 'admin' is used.
; panel-username: admin
; Panel administrator password. If not specified, it is automatically detected.
panel-password: required_password
[pfw]
; An IP v4 address of this source Plesk server.
ip: 203.0.113.300
; Panel administrator user name. If not specified, 'admin' is used.
; panel-username: admin
; Panel administrator password. If not specified, it is automatically detected.
panel-password: required_password
; User name of the privileged system user on this Plesk server. Default is 'Administrator'.
; windows-username: Administrator
; Password of the privileged system user on this Plesk server.
windows-password: required_password -
Generate the migration list:
C:\> "%plesk_dir%\admin\plib\modules\panel-migrator\backend\plesk-migrator.bat" generate-migration-list
-
Update
external_id
on the source server:C:\> "%plesk_dir%\admin\plib\modules\panel-migrator\backend\plesk-migrator.bat" set-external-id
- Login to the source server via RDP.
- Generate list of client's and their external id's:
C:\> plesk db -NBe "select login,external_id from clients where parent_id = 1 and (external_id != NULL or external_id != '0' or external_id <> '')" > C:\clients.txt
- Copy
C:\clients.txt
from the source server to destination one. - Login to the destination server via RDP.
- Create backup of psa database:
C:\> plesk db dump psa > C:\psa._before_clietnsExtId_update.sql
- Execute below command to update client's external id on destination server:
C:\> for /f "usebackq tokens=1,2" %a in (C:\clients.txt) do plesk db "update clients set external_id='%b' where login='%a'"
-
Connect to the target server via SSH;
-
Copy sample configuration file from the
/usr/local/psa/admin/plib/modules/panel-migrator/backend/conf/samples/plesk-unix.ini
to/usr/local/psa/var/modules/panel-migrator/conf/
and rename it:# mkdir /usr/local/psa/var/modules/panel-migrator/conf/
# cp /usr/local/psa/admin/plib/modules/panel-migrator/backend/conf/samples/plesk-unix.ini /usr/local/psa/var/modules/panel-migrator/conf/config.ini -
Specify IP addresses of source and target server and their credentials in
config.ini
file, for example:CONFIG_TEXT: [plesk]
# This section defines target panel settings.
# [mandatory] ip
# An IPv4 address of the target Plesk server.
ip: 203.0.113.200
[pfu]
# This section defines settings of source Plesk server 'pfu1'.
# [mandatory] ip
# An IP v4 address of this source Plesk server.
ip: 203.0.113.300 -
Generate the migration list:
# /usr/local/psa/admin/sbin/modules/panel-migrator/plesk-migrator generate-migration-list
-
Update
external_id
on the source server:# /usr/local/psa/admin/sbin/modules/panel-migrator/plesk-migrator set-external-id
Comments
4 comments
We have the same issue on Linux too. Moved few servers from old Centos to new with Ubuntu and lost all external id's for WHMCS. It's alson not only on Windows.
Hi @Miomir Besarabic!
Indeed, this issue is related to Plesk Migrator extension rather then to operation system, I have updated the article with this information! Thank you.
However, In order to avoid it, the same steps should be used, the only difference is the location of the configs, it is /usr/local/psa/admin/plib/modules/panel-migrator/backend/conf/samples/.
Doesn't seem to be resolved.
Just migrated from onyx to obsidian and had the same issue. I had to add the external IDs manually
Hi Maximilian Hermann,
This is quite an old bug, which according to this https://talk.plesk.com/threads/plesk-migrator-extension.336874/ seems to be fixed a long time ago.
If you're still experiencing this issue, please verify first that the Plesk Migrator extension is up-to-date, and then open a support request.
Please sign in to leave a comment.