Articles in this section

Backup or migration fails in Plesk: Cannot dump database content of type 'mysql'

Plesk for Linux kb: technical ext: migrator ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  1. Backup fails with the following errors:

    PLESK_ERROR: Error: domain "example.com"
    Cannot dump database content 'db_example' of type 'mysql'
    Cannot backup content of database 'db_example'. The mysqldump utility has returned '2'.
    STDERR: mysqldump: Got error: 1049: Unknown database 'db_example' when selecting the database

    Or

    PLESK_WARN: Warning:
    Deployer has been terminated by exception: Line 70 Position 4 Error: The element 'migration-dump' has invalid child element 'role'. List of possible elements expected: 'reseller-info, client-info, domain-info, server'.

  2. Migration fails wit error:

    CONFIG_TEXT: Failed to copy content of database 'db_example'
    Migration tools tried to perform operation in 3 attempts: Command execution failed on the source server 'source' (203.0.113.2) with non-zero exit code.
    command: MYSQL_PWD="$(cat)" mysqldump --no-defaults -h localhost -P 3306 -uadmin --quick --quote-names --add-drop-table --default-character-set=utf8 --set-charset --routines db_example > /root/plesk_migrator/plesk_migrator-gl6g31q86s77dwpr467mreyyh2uw20nn/db-dumps/db_example.sql
    exit code: 2
    stdout:
    stderr: mysqldump: Got error: 1049: Unknown database 'db_example' when selecting the database

  3. Database db_example does not exist on the server, however, psa database contains a record about it:

    mysql> select * from data_bases where name='db_example';
    +----+-----------------+-------+--------+--------------+-----------------+
    | id | name | type | dom_id | db_server_id | default_user_id |
    +----+-----------------+-------+--------+--------------+-----------------+
    | 1 | db_example | mysql | 1 | 1 | 1 |
    +----+-----------------+-------+--------+--------------+-----------------+

Cause

Database was removed from the server manually, but was not removed from Plesk.

Resolution

Using Plesk GUI
  1. Log into Plesk
  2. Click on Remove Database for "db_example" database at Plesk > Domains > example.com > Databases.
Directly from the server
  1. Connect to the server via SSH.
  2. Create backup of psa database:

    # plesk db dump psa > psa.sql

  3. Remove the record about "db_example" database from psa database:

    # plesk db
    mysql > delete from data_bases where name='db_example';

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.