Jan 17, 2016

How to restore lost mysql database website recovery?

My web server was lost and I am now attempting to get our company website back up and running using the backups we do have. What I do have is all of the files that made up the site but what I do not have a backup of is the mysql config for the site.

Looking through some of the php files I can the database name and the user the pages are calling. What I am unable to find is a database file I could import or any documentation in the source files (that include the original files from the webdevelopers.)

How might I go about finding this information can anyone tell me where to look and secondly how I might go about finding what tables I need to make etc.

Thanks for your response. My old server was IIS and I am unable to get to it all I have are the website files from backup.

My new environment is Ubuntu lamp install. I have the server issuing the page but I get this error when I open the page:

I cannot connect to the database because: Access denied for user 'x'@'localhost' (using password: YES)

At this point I have been scouring all of the .php files and am finding two databases being called including the names and passwords two accounts. From what I can gather one set of creds is for the admin page (backdoor) and the other for the site to call mysql.

I do have the original files from the web developers and would think there would be a sample table I could import or the documentation for what tables to set up but I really don't see anything.
Tracy Perry summed this up neatly on The Admin Zone:

"If you don't have a "dump" (a backup) of the actual database for the site - the bad news is odds are you are SOL. Without the DB, you won't be able to instantly recreate your site. You will have to manually initialize a new DB, then populate it with the base tables (usually via an install routine) of whatever script you are using.
That's why a proper backup procedure backs up the actual files in the the web site and performs a dump of the DB and keeps them together so that recovery is easier.

I also now include in mine a copy of my sites vhost definition used by nginx."
Answer this