0

I'm trying to restore a WordPress website for which I have the files backup, but I don't have a DB backup on hand.

I managed to get the site up partially by restoring the backup in cPanel - all the site's pages are working now, but because there is no DB in place (wp-config.php points to what 'used to be' my DB) accessing site.com/wp-admin renders this error:

Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.

Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

I know I made a huge mistake by not backing up my website DB.

Is there any way to be able to access wp-admin in this case? Can't I 'mock' the old DB with a new one? Anything to be able to access wp-admin.

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
Remus Dutulescu
  • 67
  • 1
  • 10

2 Answers2

0

Configure a core Wordpress with fresh installation point your current Wordpress files to the new database just got created

You should copy all the settings (from DB_NAME,DB_USER,DB_PASSWORD......AUTH_KEY,SECURE_AUTH_KEY..... till table_prefix) from your new installation wp-conf to old one

You would have lost almost all data stored in db like users etc however if your theme was more file based you should be able to se pages up

This is Triel and i think it should work to bes extent dont see any other way out of this scenario.

ShaH
  • 140
  • 8
0

"Can't I 'mock' the old DB with a new one? Anything to be able to access wp-admin" Simply Create a new mysql DB on your server and put its info in your wp-config.php file.

Yahya Hussein
  • 8,767
  • 15
  • 58
  • 114