Error establishing a database connection - Moving 9 sites from a VPS in the cloud to another server - backup and restore

Moving my wordpress sites from one ip adress to another, I get " Error establishing a database connection" when I try to call up a site.

So I used the following commands:
v-backup-user username
scp /backup/username.2020.01.01-00-00.tar [email protected]:/backup/
v-restore-user different-username username.2020.01.01-00-00.tar

I use ubuntu 24.

When I try to connect to the databases php 8.4 of the sites, I fail to get through.
I then updated the password through hestiacp for a site, providing the password set in the site on the first server, and then I can connect to the database through myphp admin interface. So it seems that the passwords did not get transferred in the restore process.

But the error persists.
Any suggestions as to what I can do from here?
Is there another place where something needs to be tuned up ?
And the usernames are changed - from site1 to site2 - but this works like a charm I find.
Very impressed with this programming work.

If you restore the database to another user, the prefix will change to newuser_database, you’ll need to adjust that in your wp-config. Usualy password should be transfered properly, you still can reset them in hestia backend.

4 Likes

Thank you for quickly resolving this problem.

I edited the wp-config.php file in the public_html directory in the definitions of DB_NAME and DB_USER - which had not been touched by the restore program.

One issue less to take care of. Thanks again, Raphael.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.