• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

PHP / MYSQL question

pk698

Active member
#1
I backed up my site about 6 months ago. And I swore I backed up the database as well at that time, but it's missing. So I only have the PHP files.

Is it possible to rebuild the MYSQL database?

I'm not a coder by the way. I had this script done by a programmer on getafreelancer.

Or am I SOL on this one? :(
 

Shamil

Well-known member
#2
I lost my sql database one. Luckily I remembered one table. It's possible to recontruct, but you need to seek out each SQL statement and build/add columns to tables from there.
 

pk698

Active member
#6
I thought I had backed up through cpanel. but for some reason, I don't have the mysql file/dump. I think I pulled a Homer on that one. And I don't have web hosting with lunarpages anymore.
 
F

Floris

Guest
#7
If you do not have the mysql database, you can't restore it, sounds logical to me. sorry!
 
F

Floris

Guest
#9
If the database has the data "banana"
and you have no database backup with the content "banana" for that database > table > row > field.
You can have all the scripts in the world, but while rebuilding the database > table > row > field ....
it won't have banana in there.

A user shouldn't care about their database structure, as the script will just rebuild it for you - most web apps like forum software and alike come with installation.

It's all about the content.

People shouldn't care that they computer is stolen, or that their hard drive is broken.
You can buy a new computer and a new hard drive.
they should care that the data on the drive in that computer, is what is gone.

You can have 15 million posts (banana, banana, banana..) but you only need 1 structure.
You can rebuild the structure, of course .. but that doesn't give you back your banana.
 

Shamil

Well-known member
#10
What I always do, is with any script I build, which has uses SQL, I have a file which checks for the table, and if it's not there, re-create it. I add tables using this. It's messy, but I know it won't go anywhere.
 
F

Floris

Guest
#11
What I always do, is with any script I build, which has uses SQL, I have a file which checks for the table, and if it's not there, re-create it. I add tables using this. It's messy, but I know it won't go anywhere.
Again .. which has NOTHING to do with anybody getting their lost database back.

The database is used to store data. Lose data, you have no data.
Not sure how I can explain this to you.
 

Shamil

Well-known member
#13
Again .. which has NOTHING to do with anybody getting their lost database back.

The database is used to store data. Lose data, you have no data.
Not sure how I can explain this to you.
You can rebuild the structure, yes. But you can't recover the data. :)
Maybe I need to go to sleep now.

I know she cannot recover the database contents, but OP asked if the database could be rebuilt. To me, that does not involve the contents of the database, only the structure schema.
 

Erik

Well-known member
#14
Maybe I need to go to sleep now.

I know she cannot recover the database contents, but OP asked if the database could be rebuilt. To me, that does not involve the contents of the database, only the structure schema.
You are correct, he did literally say "rebuild." But I took it to mean "rebuild the contents of the database," i.e. the posts, users, etc. :)

Also, the OP is male (avatar is deceiving, I know). :D
 
F

Floris

Guest
#15
A database backup contains both structure and the insert rows. Unless specified it's structure only.
It's accepted to assume it implies that the importance lies with the data stores in the database.
Especially when it's what is of value, the structure means nothing, as it's easy to rebuild.