Articles in this section

Plesk Migrator is inaccessible on Plesk Onyx: unexpected 'array' (T_ARRAY), expecting variable (T_VARIABLE)

kb: technical ext: migrator Migration

Applicable to:

  • Plesk for Linux

Symptoms

  • The Plesk Migrator extension fails to open with an error:

    ERROR: syntax error, unexpected 'array' (T_ARRAY), expecting variable (T_VARIABLE) (SessionDirectory.php:13)

  • Plesk Migrator was update to a recent version

  • The server is running Plesk Onyx or old Obsidian (e.g. 18.0.34)

Cause

Recent Plesk Migrator versions are not compatible with Plesk Onyx.

Resolution

The migrator extension should be installed on the target server. It is not needed on the source server. Any migrations should be carried out to a modern, supported system.

Was this article helpful?

Comments

1 comment
Date Votes
  • "…should be carried out to a modern, supported system" unfortunately is not always possible. We have three Plesk Obisidian 18.0.28 with domains the customer doesn't want to update, so those have to use ancient PHP versions and we cannot update Debian and Plesk even if we wanted to. Now, we want to migrate the contents from one server to another, and this fails.

    Workaround is to make the code compatible with PHP 7.3 (/opt/psa/bin/sw-engine-pleskrun -v). It was sufficient to edit the following files.

    # diff /opt/psa/admin/plib/modules/panel-migrator/vendor/plesk/migration-lib-code/src/Common/SessionDirectory.php.org /opt/psa/admin/plib/modules/panel-migrator/vendor/plesk/migration-lib-code/src/Common/SessionDirectory.php
    10,13c10
    <     private static array $_instances = [];
    ---
    >     private static $_instances = [];
    15,18c12
    <     private string $_path;
    ---
    >     private $_path;
    20,23c14
    <     private string $_id;
    ---
    >     private $_id;


    /opt/psa/admin/plib/modules/panel-migrator/vendor/plesk/migration-lib-code/src/Common/SessionFiles.php

    protected SessionDirectory $_session;
    -->
    protected $_session;


    Others might be necessary in some cases but this didn't seem to be necessary for us:
    grep SessionDirectory /opt/psa/admin/plib/modules/panel-migrator -R -l

    Afterwards, PMM would transfer content but had problems restoring the Hosting Settings ("backup file is not valid or corrupted") due to unknown reasons. At least, it doesn't look like this had the same cause. Just manually compare the settings and fix accordingly.
     

    2

Please sign in to leave a comment.