Articles in this section

After restoring server-wide backup WordPress website show error: Error establishing a database connection

kb: technical Plesk

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

  1. Connect to the server via SSH

  2. 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'

  3. 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}

  4. Open the file /var/www/vhosts/example.com/httpdocs/wp-config.php and replace the password on define( 'DB_PASSWORD', 'XXXX' ); line for the new one found on step 2.

Was this article helpful?

Comments

1 comment
Date Votes

Please sign in to leave a comment.