Symptoms
-
After restoring server-wide backup in Tools & Settings > Backup Manager the WordPress websites fail with the error:
Error establishing a database connection
-
The server-wide Plesk backup was restored on a new server.
-
There is the following error in
/var/log/plesk/PMM/restore-2024-01-01-01-26-23-392/deployer.log
:INFO: PasswordGenerated The password was generated for user 'Database user user_name'. New password is 'XXXXX' [common/plesk-utils/PMM/deployer_lib/pmm_deploy_sup.cpp:PasswordGenerated]
Cause
The password was re-generated for the database and needs to be updated in the config file of the WordPress instance.
Resolution
-
Connect to the server via SSH
-
Find the warnings like below example in the restoration
deployer.log
file:INFO: (Restore hosting object 'example.com') The password was generated for user 'database_user'. New password is 'XXXX'
-
For security measures back up the
wp-config.php
file in the document root directory of the affected domain:# cp -a /var/www/vhosts/example.com/httpdocs/wp-config.php{,.back}
-
Open the file
/var/www/vhosts/example.com/httpdocs/wp-config.php
and replace the password ondefine( 'DB_PASSWORD', 'XXXX' );
line for the new one found on step 2.