Articles in this section

Plesk migration fails: database migration tools tried to perform operation in 3 attempts: a bytes-like object is required, not 'str'

kb: bug Plesk for Linux

Symptoms

Error message in Plesk Migrator logs:

CONFIG_TEXT: Subscription 'example.com'
error: Failed to copy content of database 'example_db'
Migration tools tried to perform operation in 3 attempts: a bytes-like object is required, not 'str'
...
error: Unable to restore Plesk extension 'wp-toolkit' for subscription 'example.com' on target Plesk server; subscription data of this extension will not be deployed

Cause

Plesk Migrator bug with ID PMT-5355.

Resolution

As a workaround, until the bug is resolved, export necessary databases from the source server and import them on the target server manually:

  1. Log in to Plesk on the source server.

  2. Save a copy of a database mentioned in the error message (example_db in the error message from the Symptoms section):

    2.1. Go to Websites & Domains > Databases > Export Dump in the database tools pane.
    2.2. Save a dump:
    To save a dump in a certain directory on the server, select the directory. The home directory of your subscription is used by default.
    Select Automatically download dump after creation.

  3. Log in to Plesk on the target server.

  4. Deploy your copy of a database in Plesk:

    4.1. Go to Websites & Domains > Databases > Import Dump in the database tools pane.

    4.2. Select a dump to deploy:
    To deploy a dump from your local computer, select Upload and click Browse. Then select the ZIP archive containing the dump file.
    To deploy a dump from a directory on the server, select Import and select the dump file.
    To deploy the dump into a newly created database, select Recreate the database. The old database will be deleted and a new one, with the same name, created.

Was this article helpful?

Comments

3 comments
Date Votes
  • The restore steps make no sense. Should we first manually create the missing domain in the new plesk and then import the db there? 

    0
  • or Maybe steps are different for this error? 

     

    Failed to perform an action on subscription': Failed to deploy subscription ''

    Migration for that subscription is considered completely failed. No further actions are performed for it. Exception message: Migration tools tried to perform operation in 3 attempts: Unable to create subscription ''.

    cannot use a string pattern on a bytes-like object

    0
  • is there not any workaround avaible? we need to migrate 400+ databases/sites... :-(

    1

Please sign in to leave a comment.