Symptoms
-
Backup fails with the following errors:
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 databaseOr
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'. - Migration fails wit error:
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 -
Database
does not exist on the server, however,
db_example
database contains a record about it:
psa
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
- Log into Plesk
- Click on Remove Database for "db_example" database at Plesk > Domains > example.com > Databases.
Directly from the server
- Connect to the server via SSH.
- Create backup of psa database:
# plesk db dump psa > psa.sql
- Remove the record about "db_example" database from psa database:
# plesk db
mysql > delete from data_bases where name='db_example';